# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 110
n 110(None)[return ret
]:
	i: 27(AL), 109()
	o: 

nname: 109
n 109(None)[]:
	i: 39(AF), 105()
	o: 110()

nname: 105
n 105(None)[]:
	i: 46(f), 64()
	o: 109()

nname: 64
n 64(None)[root, sub = plug.split('.', 1)
ret.add(sub)
continue
]:
	i: 46(t)
	o: 105()

nname: 46
n 46(plug.startswith(prefix))[for plug in self:
]:
	i: 39(for)
	o: 64(t), 105(f)

nname: 39
n 39(None)[]:
	i: 27(loop)
	o: 46(for), 109(AF)

nname: 27
n 27(None)[ret = set()
]:
	i: 12(), 26()
	o: 39(loop), 110(AL)

nname: 26
n 26(None)[]:
	i: 0(f)
	o: 27()

nname: 12
n 12(None)[return list(self)
]:
	i: 0(t)
	o: 27()

nname: 0
n 0(prefix is None)[]:
	i: 
	o: 12(t), 26(f)

nname: 110
n 110(None)[return ret
]:
	i: 0(AL), 39(AF), 46()
	o: 

nname: 46
n 46(None)[for plug in self:
if plug.startswith(prefix):
	root, sub = plug.split('.', 1)
	ret.add(sub)
	continue
]:
	i: 39(for)
	o: 110()

nname: 39
n 39(None)[]:
	i: 0(loop)
	o: 46(for), 110(AF)

nname: 0
n 0(None)[if prefix is None:
	return list(self)
ret = set()
]:
	i: 
	o: 39(loop), 110(AL)

self.nodes: {0: <unpyclib.structure.node instance at 0xb75caa4c>, 39: <unpyclib.structure.node instance at 0xb75cab4c>, 46: <unpyclib.structure.node instance at 0xb75caacc>, 110: <unpyclib.structure.node instance at 0xb75cadec>}
nname: 6
n 6(None)[__doc__ = "This classe provides a collections of availble plugins\n    that can be loaded to modify the wybox's behavior.\n    Plugins's naming convention is '(universe|module).value'"
def get(self, prefix=None):
	if prefix is None:
		return list(self)
	ret = set()

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb7614e6c>}
nname: 0
n 0(None)[dict.__init__(self, values)
self.key = key
self.parent = parent
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75ca26c>}
nname: 159
n 159(None)[]:
	i: 129(), 158()
	o: 

nname: 158
n 158(None)[]:
	i: 117(f)
	o: 159()

nname: 129
n 129(None)[self.parent.notify_change(self.key, key, value)
]:
	i: 117(t)
	o: 159()

nname: 117
n 117(self.parent.notify_subs)[]:
	i: 50(), 97()
	o: 129(t), 158(f)

nname: 97
n 97(None)[dict.__setitem__(self, key, value)
]:
	i: 0&12&28(f)
	o: 117()

nname: 50
n 50(None)[value = ':'.join(map(str, value))
dict.__setitem__(self, key, value)
]:
	i: 0&12&28(t)
	o: 117()

nname: 0&12&28
n 0&12&28(key == 'resolution' and self.key == 'connections' and isinstance(value, (tuple, list)))[]:
	i: 
	o: 50(t), 97(f)

nname: 0&12&28
n 0&12&28(None)[if key == 'resolution' and self.key == 'connections' and isinstance(value, (tuple, list)):
	value = ':'.join(map(str, value))
	dict.__setitem__(self, key, value)
else:
	dict.__setitem__(self, key, value)
if self.parent.notify_subs:
	self.parent.notify_change(self.key, key, value)
]:
	i: 
	o: 

self.nodes: {'0&12&28': <unpyclib.structure.node instance at 0xb75ca68c>}
nname: 89
n 89(None)[]:
	i: 28(), 72()
	o: 

nname: 72
n 72(None)[return dict.__getitem__(self, key)
]:
	i: 0&12(f)
	o: 89()

nname: 28
n 28(None)[return tuple(map(int, dict.__getitem__(self, key).split(':')))
]:
	i: 0&12(t)
	o: 89()

nname: 0&12
n 0&12(key == 'resolution' and self.key == 'connections')[]:
	i: 
	o: 28(t), 72(f)

nname: 0&12
n 0&12(None)[if key == 'resolution' and self.key == 'connections':
	return tuple(map(int, dict.__getitem__(self, key).split(':')))
else:
	return dict.__getitem__(self, key)
]:
	i: 
	o: 

self.nodes: {'0&12': <unpyclib.structure.node instance at 0xb75ca20c>}
nname: 6
n 6(None)[def __init__(self, values, key, parent):
	dict.__init__(self, values)
	self.key = key
	self.parent = parent

def __setitem__(self, key, value):
	if key == 'resolution' and self.key == 'connections' and isinstance(value, (tuple, list)):
		value = ':'.join(map(str, value))
		dict.__setitem__(self, key, value)
	else:
		dict.__setitem__(self, key, value)
	if self.parent.notify_subs:
		self.parent.notify_change(self.key, key, value)

def __getitem__(self, key):
	if key == 'resolution' and self.key == 'connections':
		return tuple(map(int, dict.__getitem__(self, key).split(':')))
	else:
		return dict.__getitem__(self, key)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75ca36c>}
nname: 164
n 164(None)[self.notify_subs = True
return None
]:
	i: 23(AL), 163()
	o: 

nname: 163
n 163(None)[]:
	i: 80(AF), 146()
	o: 164()

nname: 146
n 146(None)[self.subs_dict[key] = val
]:
	i: 93(f), 117()
	o: 163()

nname: 117
n 117(None)[self.subs_dict[key] = _SubDict(val, key, self)
continue
]:
	i: 93(t)
	o: 146()

nname: 93
n 93(isinstance(val, dict))[for key, val in conf.iteritems():
]:
	i: 80(for)
	o: 117(t), 146(f)

nname: 80
n 80(None)[]:
	i: 23(loop)
	o: 93(for), 163(AF)

nname: 23
n 23(None)[conf = {}
self.diff_dict = dict(config_version=conf.get('config_version', -1))
self.subs_dict = dict()
self.notify_subs = False
]:
	i: 12(), 19()
	o: 80(loop), 164(AL)

nname: 19
n 19(None)[]:
	i: 0(f)
	o: 23()

nname: 12
n 12(None)[]:
	i: 0(t)
	o: 23()

nname: 0
n 0(conf is not None)[]:
	i: 
	o: 12(t), 19(f)

nname: 164
n 164(None)[self.notify_subs = True
return None
]:
	i: 0(AL), 80(AF), 93()
	o: 

nname: 93
n 93(None)[for key, val in conf.iteritems():
if isinstance(val, dict):
	self.subs_dict[key] = _SubDict(val, key, self)
	continue
self.subs_dict[key] = val
]:
	i: 80(for)
	o: 164()

nname: 80
n 80(None)[]:
	i: 0(loop)
	o: 93(for), 164(AF)

nname: 0
n 0(None)[if conf is not None:
	pass
conf = {}
self.diff_dict = dict(config_version=conf.get('config_version', -1))
self.subs_dict = dict()
self.notify_subs = False
]:
	i: 
	o: 80(loop), 164(AL)

self.nodes: {0: <unpyclib.structure.node instance at 0xb759750c>, 164: <unpyclib.structure.node instance at 0xb75c824c>, 80: <unpyclib.structure.node instance at 0xb75972cc>, 93: <unpyclib.structure.node instance at 0xb759772c>}
nname: 0
n 0(None)[return self.subs_dict[key]
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75ca12c>}
nname: 0
n 0(None)[return self.subs_dict.get(key, default)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75ca9ac>}
nname: 158
n 158(None)[self.notify_subs = False
self.subs_dict[id][key] = value
self.notify_subs = True
]:
	i: 24(JA), 55(JA), 86(), 121(), 143(), 157()
	o: 

nname: 157
n 157(None)[]:
	i: 130(t)
	o: 158()

nname: 143
n 143(None)[del self.diff_dict[id]
]:
	i: 130(f)
	o: 158()

nname: 130
n 130(self.diff_dict[id])[]:
	i: 93(), 128(AE)
	o: 143(f), 157(t)

nname: 128
n 128(None)[]:
	i: 111(f)
	o: 130(AE)

nname: 121
n 121(None)[]:
	i: 111(t)
	o: 158()

nname: 111
n 111(<dummy_ex3> EXC_MATCH KeyError)[]:
	i: 89(except)
	o: 121(t), 128(f)

nname: 93
n 93(None)[del self.diff_dict[id][key]
]:
	i: 89(try)
	o: 130()

nname: 89
n 89(None)[]:
	i: 0(f)
	o: 93(try), 111(except)

nname: 86
n 86(None)[]:
	i: 84(AE)
	o: 158()

nname: 84
n 84(None)[]:
	i: 45(f)
	o: 86(AE)

nname: 55
n 55(None)[self.diff_dict[id] = {key: value}
]:
	i: 45(t)
	o: 158(JA)

nname: 45
n 45(<dummy_ex3> EXC_MATCH KeyError)[]:
	i: 20(except)
	o: 55(t), 84(f)

nname: 24
n 24(None)[self.diff_dict[id][key] = value
]:
	i: 20(try)
	o: 158(JA)

nname: 20
n 20(None)[]:
	i: 0(t)
	o: 24(try), 45(except)

nname: 0
n 0(default_conf[id][key] != value)[]:
	i: 
	o: 20(t), 89(f)

nname: 158
n 158(None)[self.notify_subs = False
self.subs_dict[id][key] = value
self.notify_subs = True
]:
	i: 24(JA), 55(JA), 130(), 111(f), 45(f), 84(AE), 111(t)
	o: 

nname: 111
n 111(<dummy_ex3> EXC_MATCH KeyError)[]:
	i: 89(except)
	o: 158(f)

nname: 130
n 130(None)[if not self.diff_dict[id]:
	del self.diff_dict[id]
]:
	i: 93(), 128(AE)
	o: 158()

nname: 93
n 93(None)[del self.diff_dict[id][key]
]:
	i: 89(try)
	o: 130()

nname: 89
n 89(None)[]:
	i: 0(f)
	o: 93(try), 111(except)

structureSingleExcept Exception 'NoneType' object has no attribute 'toNode'
nname: 55
n 55(None)[self.diff_dict[id] = {key: value}
]:
	i: 45(t)
	o: 158(JA)

nname: 45
n 45(<dummy_ex3> EXC_MATCH KeyError)[]:
	i: 20(except)
	o: 55(t), 158(f)

nname: 24
n 24(None)[self.diff_dict[id][key] = value
]:
	i: 20(try)
	o: 158(JA)

nname: 20
n 20(None)[]:
	i: 0(t)
	o: 24(try), 45(except)

nname: 0
n 0(default_conf[id][key] != value)[]:
	i: 
	o: 20(t), 89(f)

nname: 158
n 158(None)[self.notify_subs = False
self.subs_dict[id][key] = value
self.notify_subs = True
]:
	i: 130(), 45(f), 111(t), 89(except)
	o: 

nname: 130
n 130(None)[if not self.diff_dict[id]:
	del self.diff_dict[id]
]:
	i: 93(), 128(AE)
	o: 158()

nname: 93
n 93(None)[del self.diff_dict[id][key]
]:
	i: 89(try)
	o: 130()

nname: 89
n 89(None)[]:
	i: 0(f)
	o: 93(try), 158(except)

nname: 45
n 45(None)[except KeyError:
	self.diff_dict[id] = {key: value}
]:
	i: 20()
	o: 158(JA)

nname: 20
n 20(None)[try:
	self.diff_dict[id][key] = value
]:
	i: 0(t)
	o: 45()

nname: 0
n 0(default_conf[id][key] != value)[]:
	i: 
	o: 20(t), 89(f)

nname: 158
n 158(None)[except:
	self.notify_subs = False
	self.subs_dict[id][key] = value
	self.notify_subs = True
]:
	i: 130(), 20(f), 111(t), 89(except)
	o: 

nname: 130
n 130(None)[if not self.diff_dict[id]:
	del self.diff_dict[id]
]:
	i: 93(), 128(AE)
	o: 158()

nname: 93
n 93(None)[del self.diff_dict[id][key]
]:
	i: 89(try)
	o: 130()

nname: 89
n 89(None)[]:
	i: 0(f)
	o: 93(try), 158(except)

nname: 20
n 20(None)[try:
	self.diff_dict[id][key] = value
except KeyError:
	self.diff_dict[id] = {key: value}
]:
	i: 0(t)
	o: 158(JA)

nname: 0
n 0(default_conf[id][key] != value)[]:
	i: 
	o: 20(t), 89(f)

self.nodes: {0: <unpyclib.structure.node instance at 0xb75c8dac>, 128: <unpyclib.structure.node instance at 0xb75c842c>, 130: <unpyclib.structure.node instance at 0xb7584fac>, 89: <unpyclib.structure.node instance at 0xb75c8b0c>, 20: <unpyclib.structure.node instance at 0xb7584e6c>, 93: <unpyclib.structure.node instance at 0xb75c864c>, 158: <unpyclib.structure.node instance at 0xb75c81ac>}
nname: 161
n 161(None)[self.notify_subs = True
self.diff_dict.update(E, **F)
self.save()
]:
	i: 85(AL), 160()
	o: 

nname: 160
n 160(None)[]:
	i: 88(AF), 156()
	o: 161()

nname: 156
n 156(None)[]:
	i: 101(f), 132()
	o: 160()

nname: 132
n 132(None)[self.subs_dict[key].update(val)
continue
]:
	i: 101(t)
	o: 156()

nname: 101
n 101(isinstance(self.subs_dict[key], dict))[for key, val in F.iteritems():
]:
	i: 88(for)
	o: 132(t), 156(f)

nname: 88
n 88(None)[]:
	i: 85(loop)
	o: 101(for), 160(AF)

nname: 85
n 85(None)[]:
	i: 0(AL), 84()
	o: 88(loop), 161(AL)

nname: 84
n 84(None)[]:
	i: 12(AF), 80()
	o: 85()

nname: 80
n 80(None)[]:
	i: 25(f), 56()
	o: 84()

nname: 56
n 56(None)[self.subs_dict[key].update(val)
continue
]:
	i: 25(t)
	o: 80()

nname: 25
n 25(isinstance(self.subs_dict[key], dict))[for key, val in E.iteritems():
]:
	i: 12(for)
	o: 56(t), 80(f)

nname: 12
n 12(None)[]:
	i: 0(loop)
	o: 25(for), 84(AF)

nname: 0
n 0(None)[self.notify_subs = False
]:
	i: 
	o: 12(loop), 85(AL)

nname: 161
n 161(None)[self.notify_subs = True
self.diff_dict.update(E, **F)
self.save()
]:
	i: 85(AL), 88(AF), 101()
	o: 

nname: 101
n 101(None)[for key, val in F.iteritems():
if isinstance(self.subs_dict[key], dict):
	self.subs_dict[key].update(val)
	continue
]:
	i: 88(for)
	o: 161()

nname: 88
n 88(None)[]:
	i: 85(loop)
	o: 101(for), 161(AF)

nname: 85
n 85(None)[]:
	i: 0(AL), 12(AF), 25()
	o: 88(loop), 161(AL)

nname: 25
n 25(None)[for key, val in E.iteritems():
if isinstance(self.subs_dict[key], dict):
	self.subs_dict[key].update(val)
	continue
]:
	i: 12(for)
	o: 85()

nname: 12
n 12(None)[]:
	i: 0(loop)
	o: 25(for), 85(AF)

nname: 0
n 0(None)[self.notify_subs = False
]:
	i: 
	o: 12(loop), 85(AL)

nname: 161
n 161(None)[self.notify_subs = True
self.diff_dict.update(E, **F)
self.save()
]:
	i: 88()
	o: 

nname: 88
n 88(None)[for key, val in F.iteritems():
	if isinstance(self.subs_dict[key], dict):
		self.subs_dict[key].update(val)
		continue
]:
	i: 25(loop)
	o: 161()

nname: 25
n 25(None)[for key, val in E.iteritems():
	if isinstance(self.subs_dict[key], dict):
		self.subs_dict[key].update(val)
		continue
]:
	i: 0(for)
	o: 88(loop)

nname: 0
n 0(None)[self.notify_subs = False
]:
	i: 
	o: 25(for)

nname: 88
n 88(None)[for key, val in F.iteritems():
	if isinstance(self.subs_dict[key], dict):
		self.subs_dict[key].update(val)
		continue
self.notify_subs = True
self.diff_dict.update(E, **F)
self.save()
]:
	i: 0(loop)
	o: 

nname: 0
n 0(None)[self.notify_subs = False
for key, val in E.iteritems():
	if isinstance(self.subs_dict[key], dict):
		self.subs_dict[key].update(val)
		continue
]:
	i: 
	o: 88(loop)

nname: 0
n 0(None)[self.notify_subs = False
for key, val in E.iteritems():
	if isinstance(self.subs_dict[key], dict):
		self.subs_dict[key].update(val)
		continue
for key, val in F.iteritems():
	if isinstance(self.subs_dict[key], dict):
		self.subs_dict[key].update(val)
		continue
self.notify_subs = True
self.diff_dict.update(E, **F)
self.save()
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75c866c>}
nname: 100
n 100(None)[]:
	i: 22(), 99()
	o: 

nname: 99
n 99(None)[]:
	i: 0&12(f)
	o: 100()

nname: 22
n 22(None)[stream = open(persistent_config_path, 'wb')
json.dump(self.diff_dict, stream)
stream.flush()
os.fsync(stream.fileno())
stream.close()
]:
	i: 0&12(t)
	o: 100()

nname: 0&12
n 0&12('persistence' in plugins and self.diff_dict)[]:
	i: 
	o: 22(t), 99(f)

nname: 0&12
n 0&12(None)[if 'persistence' in plugins and self.diff_dict:
	stream = open(persistent_config_path, 'wb')
	json.dump(self.diff_dict, stream)
	stream.flush()
	os.fsync(stream.fileno())
	stream.close()
]:
	i: 
	o: 

self.nodes: {'0&12': <unpyclib.structure.node instance at 0xb75ca32c>}
nname: 6
n 6(None)[__doc__ = "User configuration storage class. Used to store preferences that\n    should be restored after relaunching pygui.\n\n    This class behaves like a dict, except that whenever one of its mappings\n    is modified, it writes itself to disk.\n\n    You should not use mutable values -- if you do, there's no guarantee that\n    changes made to them will be in fact written to disk. If you want to\n    ensure that changes are written to disk, use the save() method.\n\n\n    /!\\ Important note to developers: /!\\ There is now a config_version key\n    at the UserConfig's root. Whenever you change the structure of UserConfig,\n    (i.e. make changes that could cause the application to crash if UserConfig\n    got overwritten with an older version), please increase config_version by one.\n\n    This will cause pygui to erase the now-obsolete version of the file and revert\n    to default settings upon launch (the new settings will, of course, be saved).\n\n    Hopefully this will save us a lot of grief from users who update pygui\n    without reading their e-mails. Won't prevent a few problems from happening,\n    though (the whole UserConfig thing is, after all, a quick & dirty hack).\n    "
def __init__(self, conf=None):
	if conf is not None:
		pass
	conf = {}
	self.diff_dict = dict(config_version=conf.get('config_version', -1))
	self.subs_dict = dict()
	self.notify_subs = False

def __getitem__(self, key):
	return self.subs_dict[key]

def get(self, key, default=None):
	return self.subs_dict.get(key, default)

def notify_change(self, id, key, value):
	pass

def update(self, E, **F):
	self.notify_subs = False
	for key, val in E.iteritems():
		if isinstance(self.subs_dict[key], dict):
			self.subs_dict[key].update(val)
			continue
	for key, val in F.iteritems():
		if isinstance(self.subs_dict[key], dict):
			self.subs_dict[key].update(val)
			continue
	self.notify_subs = True
	self.diff_dict.update(E, **F)
	self.save()

def save(self):
	if 'persistence' in plugins and self.diff_dict:
		stream = open(persistent_config_path, 'wb')
		json.dump(self.diff_dict, stream)
		stream.flush()
		os.fsync(stream.fileno())
		stream.close()

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75ca0ac>}
nname: 2777
n 2777(None)[]:
	i: 2724(JA), 2738(JA), 2760(), 2763()
	o: 

nname: 2763
n 2763(None)[log.warn('Configuration persistence disabled. Using default values.')
]:
	i: 2546(f)
	o: 2777()

nname: 2760
n 2760(None)[]:
	i: 2758(AE)
	o: 2777()

nname: 2758
n 2758(None)[]:
	i: 2728(f)
	o: 2760(AE)

nname: 2738
n 2738(None)[log.warn('Unable to load persistent system configuration. Using default values.')
]:
	i: 2728(t)
	o: 2777(JA)

nname: 2728
n 2728(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 2614(except)
	o: 2738(t), 2758(f)

nname: 2724
n 2724(None)[]:
	i: 2667(), 2697()
	o: 2777(JA)

nname: 2697
n 2697(None)[log.warn('Previous system configuration found with an incompatible schema. Discarding it.')
os.unlink(persistent_config_path)
]:
	i: 2618(f)
	o: 2724()

nname: 2667
n 2667(None)[user_config.update(rw_config)
log.info('System configuration from a previous session found and loaded.')
]:
	i: 2618(t)
	o: 2724()

nname: 2618
n 2618(user_config['config_version'] == rw_config.get('config_version', -1))[rw_config = json.load(open(persistent_config_path))
]:
	i: 2614(try)
	o: 2667(t), 2697(f)

nname: 2614
n 2614(None)[]:
	i: 2546(t)
	o: 2618(try), 2728(except)

nname: 2546
n 2546('persistence' in plugins)[class _SubDict(dict):
	def __init__(self, values, key, parent):
		dict.__init__(self, values)
		self.key = key
		self.parent = parent

	def __setitem__(self, key, value):
		if key == 'resolution' and self.key == 'connections' and isinstance(value, (tuple, list)):
			value = ':'.join(map(str, value))
			dict.__setitem__(self, key, value)
		else:
			dict.__setitem__(self, key, value)
		if self.parent.notify_subs:
			self.parent.notify_change(self.key, key, value)

	def __getitem__(self, key):
		if key == 'resolution' and self.key == 'connections':
			return tuple(map(int, dict.__getitem__(self, key).split(':')))
		else:
			return dict.__getitem__(self, key)



class UserConfig(object):
	__doc__ = "User configuration storage class. Used to store preferences that\n    should be restored after relaunching pygui.\n\n    This class behaves like a dict, except that whenever one of its mappings\n    is modified, it writes itself to disk.\n\n    You should not use mutable values -- if you do, there's no guarantee that\n    changes made to them will be in fact written to disk. If you want to\n    ensure that changes are written to disk, use the save() method.\n\n\n    /!\\ Important note to developers: /!\\ There is now a config_version key\n    at the UserConfig's root. Whenever you change the structure of UserConfig,\n    (i.e. make changes that could cause the application to crash if UserConfig\n    got overwritten with an older version), please increase config_version by one.\n\n    This will cause pygui to erase the now-obsolete version of the file and revert\n    to default settings upon launch (the new settings will, of course, be saved).\n\n    Hopefully this will save us a lot of grief from users who update pygui\n    without reading their e-mails. Won't prevent a few problems from happening,\n    though (the whole UserConfig thing is, after all, a quick & dirty hack).\n    "
	def __init__(self, conf=None):
		if conf is not None:
			pass
		conf = {}
		self.diff_dict = dict(config_version=conf.get('config_version', -1))
		self.subs_dict = dict()
		self.notify_subs = False

	def __getitem__(self, key):
		return self.subs_dict[key]

	def get(self, key, default=None):
		return self.subs_dict.get(key, default)

	def notify_change(self, id, key, value):
		pass

	def update(self, E, **F):
		self.notify_subs = False
		for key, val in E.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		for key, val in F.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		self.notify_subs = True
		self.diff_dict.update(E, **F)
		self.save()

	def save(self):
		if 'persistence' in plugins and self.diff_dict:
			stream = open(persistent_config_path, 'wb')
			json.dump(self.diff_dict, stream)
			stream.flush()
			os.fsync(stream.fileno())
			stream.close()



user_config = UserConfig(default_conf)
]:
	i: 2516(), 2545()
	o: 2614(t), 2763(f)

nname: 2545
n 2545(None)[]:
	i: 2480(f)
	o: 2546()

nname: 2516
n 2516(None)[output_driver = 'dummy'
architecture = 'pc'
plugins.discard('persistence')
]:
	i: 2480(t)
	o: 2546()

nname: 2480
n 2480(platform.machine() != 'sh4')[persistent_config_path = '/etc/params/wy_config'
import platform
]:
	i: 2378(AL), 2479()
	o: 2516(t), 2545(f)

nname: 2479
n 2479(None)[]:
	i: 2381(AF), 2462()
	o: 2480()

nname: 2462
n 2462(None)[plugins.add(plug)
]:
	i: 2422(f), 2441()
	o: 2479()

nname: 2441
n 2441(None)[plugins.discard(plug[1:])
continue
]:
	i: 2422(t)
	o: 2462()

nname: 2422
n 2422(plug[0] == '-')[for plug in <genexpr>(os.environ.get('PLUGINS', '').split(':')):
]:
	i: 2381(for)
	o: 2441(t), 2462(f)

nname: 2381
n 2381(None)[]:
	i: 2378(loop)
	o: 2422(for), 2479(AF)

nname: 2378
n 2378(None)[]:
	i: 2266(), 2356(), 2376(AE)
	o: 2381(loop), 2480(AL)

nname: 2376
n 2376(None)[]:
	i: 2346(f)
	o: 2378(AE)

nname: 2356
n 2356(None)[log.info('No local configuration found.')
]:
	i: 2346(t)
	o: 2378()

nname: 2346
n 2346(<dummy_ex3> EXC_MATCH IOError)[]:
	i: 1866(except)
	o: 2356(t), 2376(f)

nname: 2266
n 2266(None)[user_configuration = os.path.join(user_config_dir, 'local_conf.py')
_loc = {}
execfile(user_configuration, restricted_env, _loc)
locals().update(_loc)
log.debug('user configuration file : %s' % user_configuration)
]:
	i: 1866(try)
	o: 2378()

nname: 1866
n 1866(None)[default_conf = {'config_version': 18, 'connections': {'resolution': '1280:720:0:50', 'active_device': 'hdmi', 'composite_output': 'pal', 'component_output': 'rgb', 'hdmi_sound': False, 'auto_frame_rate': False, 'spdif_surround': False, 'scart1_io_mode': 'out', 'scart1_in_mode': 'composite', 'scart1_out_mode': 'rgb', 'scart2_io_mode': 'in', 'scart2_in_mode': 'rgb', 'scart2_out_mode': 's-video'}, 'video': {'language': HMI_VIDEO['languages'][0], 'aspect_ratio': HMI_VIDEO['aspect_ratio'][0], 'display_format': 'letter_box', 'channel': HMI_VIDEO['channels'][0], 'dvdmenulanguage': HMI_VIDEO['languages'][0], 'dvdmovielanguage': HMI_VIDEO['languages'][0], 'dvdsubtitlelanguage': HMI_VIDEO['languages'][0], 'dvdbrowse': False, 'dvdautolaunch': False, 'dvdprotectionlevel': 0, 'dvdchannel': HMI_VIDEO['channels'][0], 'subtitlesfiles': False}, 'music': {'ripcodec': HMI_MUSIC['codecs'][0], 'riprate': HMI_MUSIC['rates'][1], 'autorip': False}, 'photo': {'filename': True, 'zoom': False, 'transition': HMI_PHOTO['transitions'][0], 'period': HMI_PHOTO['slideshow'][0]}, 'tv': {'record_duration': HMI_TV['records_duration'][0], 'max_record_duration': HMI_TV['max_record_duration'], 'epg_margin': HMI_TV['epg_margins'][1], 'timeshift_length': HMI_TV['timeshift_length'][-1], 'lnb_high_voltage': False, 'last_scan_time': 0, 'scan_with_scrambled': True, 'last_channel_index': None, 'last_favorite_name': u'all_channels_list'}, 'base': {'help_banner': 1, 'country': HMI_BASE['country'][0], 'language': default_language, 'timeupdatemode': 3, 'timeformat': 1, 'dateformat': 0, 'timezone': 'Europe/Paris', 'firstboot': True}, 'security': {'secretcode': None, 'parent_mode': True, 'parental_control': False, 'show_hidden': True, 'question': None, 'answer': None, 'maturity_rating': 0}, 'power': {'screensaver_type': 'image', 'screensaver_threshold': 300}, 'sound': {'volume': 10, 'mute': 0}, 'network': {'type': 'wired', 'iface': 'eth0', 'upnp': True, 'wifi_name': None, 'wifi_security': None, 'wifi_key': None}, 'advanced': {'start_on_demo_mode': False, 'last_universe': None, 'demo_mode': False}, 'net': {'login': None, 'password': None}}
restricted_env = {'__builtins__': None, 'plugins': plugins, 'True': True, 'False': False, 'HMI_BASE': HMI_BASE, 'HMI_VIDEO': HMI_VIDEO, 'HMI_MUSIC': HMI_MUSIC, 'HMI_PHOTO': HMI_PHOTO, 'HMI_TV': HMI_TV}
]:
	i: 406(t), 1862()
	o: 2266(try), 2346(except)

nname: 1862
n 1862(None)[]:
	i: 406(f)
	o: 1866()

nname: 406
n 406(default_language)[code_profiler = False
shutdown = True
class PluginSet(set):
	__doc__ = "This classe provides a collections of availble plugins\n    that can be loaded to modify the wybox's behavior.\n    Plugins's naming convention is '(universe|module).value'"
	def get(self, prefix=None):
		if prefix is None:
			return list(self)
		ret = set()



plugins = PluginSet(('tv', 'acquisition', 'dvd', 'wymedia', 'wyvas', 'persistence', 'youtube', 'dailymotion', 'popup_blocker', 'wifi', 'input.lirc', 'home.tv', 'home.acquisition', 'home.audio', 'home.video_image', 'home.radio', 'home.web', 'home.games', 'home.parameters', 'hand_actions.navigator', 'hand_actions.marker_navigator', 'hand_actions.player', 'hand_actions.dvd_player', 'hand_actions.tv_player', 'hand_actions.video_image_thumbnail', 'hand_actions.webbrowser', 'gui_engine.mediamenu', 'gui_engine.menu', 'gui_engine.setupparameters', 'gui_engine.tv', 'gui_engine.web', 'gui_engine.window', 'listing.fixed', 'listing.hybrid', 'listing.default', 'parameters.1.tv', 'parameters.2.videophoto', 'parameters.3.generalsetup', 'parameters.4.connections', 'parameters.5.network', 'parameters.6.advanced', 'parameters.7.version'))
import sys
user_config_dir = '/etc/'
rw_dir = '/etc/params/'
HMI_MUSIC = {'lazy_selection': 1.0, 'forward': [2, 4, 6, 10], 'backward': [-2, -4, -6, -10], 'codecs': ['wav', 'mp3', 'ogg'], 'rates': [128, 192, 256, 320], 'left': -5, 'right': 5}
HMI_VIDEO = {'lazy_selection': 0.5, 'languages': ['fr', 'en', 'de', 'es', 'pt', 'nl'], 'aspect_ratio': [0, 1], 'channels': [1, 2, 3, 6, 7], 'channel': 2, 'idle_threshold': 8, 'forward': [2, 3, 6, 12, 25, 50, 100, 300], 'backward': [-2, -3, -6, -12, -25, -50, -100, -300], 'slow': [0.20000000000000001, 0.5, 0.80000000000000004], 'reverse_slow': [0.0], 'seek_percent': 0.10000000000000001, 'seek_period': 72}
HMI_PHOTO = {'lazy_selection': 0.5, 'transitions': ['no_transition', 'fade_to_black', 'fade', 'top_slide'], 'slideshow': [15.0, 10.0, 5.0, 3.0], 'jump': 5, 'thumbnail_row_length': 5}
HMI_BASE = {'preview_delay': 0.5, 'helpbanner_duration': 5.0, 'navigator_listing_delay': 0.20000000000000001, 'search_navigator_delay': 1.3, 'volumewindow_duration': 2.0, 'error_signal_delay': 1.0, 'keyboard_truncate_prefix': '...', 'osd_languages': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'country': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'rcu_block_button0': 3.0, 'rcu_device_poll_interval': 0.014999999999999999, 'rcu_default_margin': 10, 'rcu_move_threshold': 15, 'rcu_gesture_threshold': 15.0, 'rcu_longclic_threshold': 7, 'rcu_buttons_repeat_delay': 0.14999999999999999, 'rcu_buttons_repeat_timeout': 0.14000000000000001, 'rcu_move_repeat_delay': 0.14999999999999999, 'rcu_move_repeat_timeout': 0.14000000000000001}
HMI_TV = {'banner_period': 5, 'record_banner_period': 5, 'record_duration_step': 1800, 'records_duration': [180], 'max_record_duration': 360, 'epg_margins': [0, 5, 10], 'timeshift_length': [30, 60, 120, 180], 'record_time': 7200, 'zap_time': 1.0, 'invert_y_axis': 0}
HMI_VIDEO['forward'] = [2, 8, 25, 100, 300]
HMI_VIDEO['backward'] = [-2, -8, -25, -100, -300]
log.debug('HMI dicts created')
restore_previous_config = True
]:
	i: 122(f), 401()
	o: 1862(f), 1866(t)

nname: 401
n 401(None)[]:
	i: 122(t)
	o: 406()

nname: 122
n 122(False)[TMP_DIR = os.getenv('TEMP', '/tmp')
no_PLAYERS = False
no_DBUS = False
fast_pushmenu = True
navigator_cache = False
socket_timeout = 20
themes_dir = '/usr/share/pygui/skins/'
locale_dir = '/usr/share/pygui/locale/'
theme_engine = 'wybox'
fps = 60
key_repeat = 3
key_q_size = 5
block_navigator = True
horizontal_selector = False
add_tv_info_banner_idle_events = False
home_order = ['*tv', 'audio', 'video_image', 'radio', 'web', 'games', 'hdmi_tv1', 'hdmi_tv2', 'image', 'video', 'net_services', 'multiverse', 'parameters', 'test_menu']
display_width, display_height = (1280, 720)
use_serialized_theme = True
default_language = None
admin_age = 100
url_list = [('Google', 'http://www.google.com'), ('WyPlay', 'http://www.wyplay.com'), ('Le Monde', 'http:www.lemonde.fr'), ('Sofinnova', 'http://www.sofinnova.fr')]
resume_video = True
resume_dvd = True
cvbs_resolution = {'pal': (720, 576, 1, 50), 'ntsc': (720, 480, 1, 59)}
random_events_sample = ('LEFT', 'RIGHT', 'UP', 'DOWN', 'HOME', 'MARKER')
random_events_duo = (('LEFT', 'RIGHT'), ('UP', 'DOWN'), ('MARKER', 'MARKER'))
output_driver = 'havana'
architecture = 'stb7100'
code_coverage = False
]:
	i: 105(), 115()
	o: 401(t), 406(f)

nname: 115
n 115(None)[DEBUG = 0
]:
	i: 0(f)
	o: 122()

nname: 105
n 105(None)[DEBUG = 1
]:
	i: 0(t)
	o: 122()

nname: 0
n 0(version == 'N/A')[from __future__ import absolute_import
import os
from peewee.debug import GET_LOGGER
from peewee.version import wybox_version
import simplejson as json
log = GET_LOGGER(__name__)
version = wybox_version()
]:
	i: 
	o: 105(t), 115(f)

nname: 2777
n 2777(None)[]:
	i: 2618(JA), 2738(JA), 2763(), 2728(f), 2758(AE)
	o: 

nname: 2763
n 2763(None)[log.warn('Configuration persistence disabled. Using default values.')
]:
	i: 2480(f)
	o: 2777()

nname: 2738
n 2738(None)[log.warn('Unable to load persistent system configuration. Using default values.')
]:
	i: 2728(t)
	o: 2777(JA)

nname: 2728
n 2728(<dummy_ex3> EXC_MATCH Exception)[]:
	i: 2614(except)
	o: 2738(t), 2777(f)

nname: 2618
n 2618(None)[rw_config = json.load(open(persistent_config_path))
if user_config['config_version'] == rw_config.get('config_version', -1):
	user_config.update(rw_config)
	log.info('System configuration from a previous session found and loaded.')
else:
	log.warn('Previous system configuration found with an incompatible schema. Discarding it.')
	os.unlink(persistent_config_path)
]:
	i: 2614(try)
	o: 2777(JA)

nname: 2614
n 2614(None)[]:
	i: 2480(t)
	o: 2618(try), 2728(except)

nname: 2480
n 2480('persistence' in plugins)[persistent_config_path = '/etc/params/wy_config'
import platform
if platform.machine() != 'sh4':
	output_driver = 'dummy'
	architecture = 'pc'
	plugins.discard('persistence')
class _SubDict(dict):
	def __init__(self, values, key, parent):
		dict.__init__(self, values)
		self.key = key
		self.parent = parent

	def __setitem__(self, key, value):
		if key == 'resolution' and self.key == 'connections' and isinstance(value, (tuple, list)):
			value = ':'.join(map(str, value))
			dict.__setitem__(self, key, value)
		else:
			dict.__setitem__(self, key, value)
		if self.parent.notify_subs:
			self.parent.notify_change(self.key, key, value)

	def __getitem__(self, key):
		if key == 'resolution' and self.key == 'connections':
			return tuple(map(int, dict.__getitem__(self, key).split(':')))
		else:
			return dict.__getitem__(self, key)



class UserConfig(object):
	__doc__ = "User configuration storage class. Used to store preferences that\n    should be restored after relaunching pygui.\n\n    This class behaves like a dict, except that whenever one of its mappings\n    is modified, it writes itself to disk.\n\n    You should not use mutable values -- if you do, there's no guarantee that\n    changes made to them will be in fact written to disk. If you want to\n    ensure that changes are written to disk, use the save() method.\n\n\n    /!\\ Important note to developers: /!\\ There is now a config_version key\n    at the UserConfig's root. Whenever you change the structure of UserConfig,\n    (i.e. make changes that could cause the application to crash if UserConfig\n    got overwritten with an older version), please increase config_version by one.\n\n    This will cause pygui to erase the now-obsolete version of the file and revert\n    to default settings upon launch (the new settings will, of course, be saved).\n\n    Hopefully this will save us a lot of grief from users who update pygui\n    without reading their e-mails. Won't prevent a few problems from happening,\n    though (the whole UserConfig thing is, after all, a quick & dirty hack).\n    "
	def __init__(self, conf=None):
		if conf is not None:
			pass
		conf = {}
		self.diff_dict = dict(config_version=conf.get('config_version', -1))
		self.subs_dict = dict()
		self.notify_subs = False

	def __getitem__(self, key):
		return self.subs_dict[key]

	def get(self, key, default=None):
		return self.subs_dict.get(key, default)

	def notify_change(self, id, key, value):
		pass

	def update(self, E, **F):
		self.notify_subs = False
		for key, val in E.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		for key, val in F.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		self.notify_subs = True
		self.diff_dict.update(E, **F)
		self.save()

	def save(self):
		if 'persistence' in plugins and self.diff_dict:
			stream = open(persistent_config_path, 'wb')
			json.dump(self.diff_dict, stream)
			stream.flush()
			os.fsync(stream.fileno())
			stream.close()



user_config = UserConfig(default_conf)
]:
	i: 2378(AL), 2381(AF), 2422()
	o: 2614(t), 2763(f)

nname: 2422
n 2422(None)[for plug in <genexpr>(os.environ.get('PLUGINS', '').split(':')):
if plug[0] == '-':
	plugins.discard(plug[1:])
	continue
plugins.add(plug)
]:
	i: 2381(for)
	o: 2480()

nname: 2381
n 2381(None)[]:
	i: 2378(loop)
	o: 2422(for), 2480(AF)

nname: 2378
n 2378(None)[]:
	i: 2266()
	o: 2381(loop), 2480(AL)

nname: 2266
n 2266(None)[try:
	user_configuration = os.path.join(user_config_dir, 'local_conf.py')
	_loc = {}
	execfile(user_configuration, restricted_env, _loc)
	locals().update(_loc)
	log.debug('user configuration file : %s' % user_configuration)
except IOError:
	log.info('No local configuration found.')
]:
	i: 406(try)
	o: 2378()

nname: 406
n 406(None)[code_profiler = False
shutdown = True
class PluginSet(set):
	__doc__ = "This classe provides a collections of availble plugins\n    that can be loaded to modify the wybox's behavior.\n    Plugins's naming convention is '(universe|module).value'"
	def get(self, prefix=None):
		if prefix is None:
			return list(self)
		ret = set()



plugins = PluginSet(('tv', 'acquisition', 'dvd', 'wymedia', 'wyvas', 'persistence', 'youtube', 'dailymotion', 'popup_blocker', 'wifi', 'input.lirc', 'home.tv', 'home.acquisition', 'home.audio', 'home.video_image', 'home.radio', 'home.web', 'home.games', 'home.parameters', 'hand_actions.navigator', 'hand_actions.marker_navigator', 'hand_actions.player', 'hand_actions.dvd_player', 'hand_actions.tv_player', 'hand_actions.video_image_thumbnail', 'hand_actions.webbrowser', 'gui_engine.mediamenu', 'gui_engine.menu', 'gui_engine.setupparameters', 'gui_engine.tv', 'gui_engine.web', 'gui_engine.window', 'listing.fixed', 'listing.hybrid', 'listing.default', 'parameters.1.tv', 'parameters.2.videophoto', 'parameters.3.generalsetup', 'parameters.4.connections', 'parameters.5.network', 'parameters.6.advanced', 'parameters.7.version'))
import sys
user_config_dir = '/etc/'
rw_dir = '/etc/params/'
HMI_MUSIC = {'lazy_selection': 1.0, 'forward': [2, 4, 6, 10], 'backward': [-2, -4, -6, -10], 'codecs': ['wav', 'mp3', 'ogg'], 'rates': [128, 192, 256, 320], 'left': -5, 'right': 5}
HMI_VIDEO = {'lazy_selection': 0.5, 'languages': ['fr', 'en', 'de', 'es', 'pt', 'nl'], 'aspect_ratio': [0, 1], 'channels': [1, 2, 3, 6, 7], 'channel': 2, 'idle_threshold': 8, 'forward': [2, 3, 6, 12, 25, 50, 100, 300], 'backward': [-2, -3, -6, -12, -25, -50, -100, -300], 'slow': [0.20000000000000001, 0.5, 0.80000000000000004], 'reverse_slow': [0.0], 'seek_percent': 0.10000000000000001, 'seek_period': 72}
HMI_PHOTO = {'lazy_selection': 0.5, 'transitions': ['no_transition', 'fade_to_black', 'fade', 'top_slide'], 'slideshow': [15.0, 10.0, 5.0, 3.0], 'jump': 5, 'thumbnail_row_length': 5}
HMI_BASE = {'preview_delay': 0.5, 'helpbanner_duration': 5.0, 'navigator_listing_delay': 0.20000000000000001, 'search_navigator_delay': 1.3, 'volumewindow_duration': 2.0, 'error_signal_delay': 1.0, 'keyboard_truncate_prefix': '...', 'osd_languages': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'country': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'rcu_block_button0': 3.0, 'rcu_device_poll_interval': 0.014999999999999999, 'rcu_default_margin': 10, 'rcu_move_threshold': 15, 'rcu_gesture_threshold': 15.0, 'rcu_longclic_threshold': 7, 'rcu_buttons_repeat_delay': 0.14999999999999999, 'rcu_buttons_repeat_timeout': 0.14000000000000001, 'rcu_move_repeat_delay': 0.14999999999999999, 'rcu_move_repeat_timeout': 0.14000000000000001}
HMI_TV = {'banner_period': 5, 'record_banner_period': 5, 'record_duration_step': 1800, 'records_duration': [180], 'max_record_duration': 360, 'epg_margins': [0, 5, 10], 'timeshift_length': [30, 60, 120, 180], 'record_time': 7200, 'zap_time': 1.0, 'invert_y_axis': 0}
HMI_VIDEO['forward'] = [2, 8, 25, 100, 300]
HMI_VIDEO['backward'] = [-2, -8, -25, -100, -300]
log.debug('HMI dicts created')
restore_previous_config = True
if not default_language:
	pass
default_conf = {'config_version': 18, 'connections': {'resolution': '1280:720:0:50', 'active_device': 'hdmi', 'composite_output': 'pal', 'component_output': 'rgb', 'hdmi_sound': False, 'auto_frame_rate': False, 'spdif_surround': False, 'scart1_io_mode': 'out', 'scart1_in_mode': 'composite', 'scart1_out_mode': 'rgb', 'scart2_io_mode': 'in', 'scart2_in_mode': 'rgb', 'scart2_out_mode': 's-video'}, 'video': {'language': HMI_VIDEO['languages'][0], 'aspect_ratio': HMI_VIDEO['aspect_ratio'][0], 'display_format': 'letter_box', 'channel': HMI_VIDEO['channels'][0], 'dvdmenulanguage': HMI_VIDEO['languages'][0], 'dvdmovielanguage': HMI_VIDEO['languages'][0], 'dvdsubtitlelanguage': HMI_VIDEO['languages'][0], 'dvdbrowse': False, 'dvdautolaunch': False, 'dvdprotectionlevel': 0, 'dvdchannel': HMI_VIDEO['channels'][0], 'subtitlesfiles': False}, 'music': {'ripcodec': HMI_MUSIC['codecs'][0], 'riprate': HMI_MUSIC['rates'][1], 'autorip': False}, 'photo': {'filename': True, 'zoom': False, 'transition': HMI_PHOTO['transitions'][0], 'period': HMI_PHOTO['slideshow'][0]}, 'tv': {'record_duration': HMI_TV['records_duration'][0], 'max_record_duration': HMI_TV['max_record_duration'], 'epg_margin': HMI_TV['epg_margins'][1], 'timeshift_length': HMI_TV['timeshift_length'][-1], 'lnb_high_voltage': False, 'last_scan_time': 0, 'scan_with_scrambled': True, 'last_channel_index': None, 'last_favorite_name': u'all_channels_list'}, 'base': {'help_banner': 1, 'country': HMI_BASE['country'][0], 'language': default_language, 'timeupdatemode': 3, 'timeformat': 1, 'dateformat': 0, 'timezone': 'Europe/Paris', 'firstboot': True}, 'security': {'secretcode': None, 'parent_mode': True, 'parental_control': False, 'show_hidden': True, 'question': None, 'answer': None, 'maturity_rating': 0}, 'power': {'screensaver_type': 'image', 'screensaver_threshold': 300}, 'sound': {'volume': 10, 'mute': 0}, 'network': {'type': 'wired', 'iface': 'eth0', 'upnp': True, 'wifi_name': None, 'wifi_security': None, 'wifi_key': None}, 'advanced': {'start_on_demo_mode': False, 'last_universe': None, 'demo_mode': False}, 'net': {'login': None, 'password': None}}
restricted_env = {'__builtins__': None, 'plugins': plugins, 'True': True, 'False': False, 'HMI_BASE': HMI_BASE, 'HMI_VIDEO': HMI_VIDEO, 'HMI_MUSIC': HMI_MUSIC, 'HMI_PHOTO': HMI_PHOTO, 'HMI_TV': HMI_TV}
]:
	i: 0(f)
	o: 2266(try)

nname: 0
n 0(None)[from __future__ import absolute_import
import os
from peewee.debug import GET_LOGGER
from peewee.version import wybox_version
import simplejson as json
log = GET_LOGGER(__name__)
version = wybox_version()
if version == 'N/A':
	DEBUG = 1
else:
	DEBUG = 0
TMP_DIR = os.getenv('TEMP', '/tmp')
no_PLAYERS = False
no_DBUS = False
fast_pushmenu = True
navigator_cache = False
socket_timeout = 20
themes_dir = '/usr/share/pygui/skins/'
locale_dir = '/usr/share/pygui/locale/'
theme_engine = 'wybox'
fps = 60
key_repeat = 3
key_q_size = 5
block_navigator = True
horizontal_selector = False
add_tv_info_banner_idle_events = False
home_order = ['*tv', 'audio', 'video_image', 'radio', 'web', 'games', 'hdmi_tv1', 'hdmi_tv2', 'image', 'video', 'net_services', 'multiverse', 'parameters', 'test_menu']
display_width, display_height = (1280, 720)
use_serialized_theme = True
default_language = None
admin_age = 100
url_list = [('Google', 'http://www.google.com'), ('WyPlay', 'http://www.wyplay.com'), ('Le Monde', 'http:www.lemonde.fr'), ('Sofinnova', 'http://www.sofinnova.fr')]
resume_video = True
resume_dvd = True
cvbs_resolution = {'pal': (720, 576, 1, 50), 'ntsc': (720, 480, 1, 59)}
random_events_sample = ('LEFT', 'RIGHT', 'UP', 'DOWN', 'HOME', 'MARKER')
random_events_duo = (('LEFT', 'RIGHT'), ('UP', 'DOWN'), ('MARKER', 'MARKER'))
output_driver = 'havana'
architecture = 'stb7100'
code_coverage = False
if False:
	pass
]:
	i: 
	o: 406()

nname: 2777
n 2777(None)[]:
	i: 2763(), 2728(f)
	o: 

nname: 2763
n 2763(None)[log.warn('Configuration persistence disabled. Using default values.')
]:
	i: 2480(f)
	o: 2777()

nname: 2728
n 2728(None)[except Exception:
	log.warn('Unable to load persistent system configuration. Using default values.')
]:
	i: 2614()
	o: 2777(JA)

nname: 2614
n 2614(None)[try:
	rw_config = json.load(open(persistent_config_path))
	if user_config['config_version'] == rw_config.get('config_version', -1):
		user_config.update(rw_config)
		log.info('System configuration from a previous session found and loaded.')
	else:
		log.warn('Previous system configuration found with an incompatible schema. Discarding it.')
		os.unlink(persistent_config_path)
]:
	i: 2480(t)
	o: 2728()

nname: 2480
n 2480('persistence' in plugins)[persistent_config_path = '/etc/params/wy_config'
import platform
if platform.machine() != 'sh4':
	output_driver = 'dummy'
	architecture = 'pc'
	plugins.discard('persistence')
class _SubDict(dict):
	def __init__(self, values, key, parent):
		dict.__init__(self, values)
		self.key = key
		self.parent = parent

	def __setitem__(self, key, value):
		if key == 'resolution' and self.key == 'connections' and isinstance(value, (tuple, list)):
			value = ':'.join(map(str, value))
			dict.__setitem__(self, key, value)
		else:
			dict.__setitem__(self, key, value)
		if self.parent.notify_subs:
			self.parent.notify_change(self.key, key, value)

	def __getitem__(self, key):
		if key == 'resolution' and self.key == 'connections':
			return tuple(map(int, dict.__getitem__(self, key).split(':')))
		else:
			return dict.__getitem__(self, key)



class UserConfig(object):
	__doc__ = "User configuration storage class. Used to store preferences that\n    should be restored after relaunching pygui.\n\n    This class behaves like a dict, except that whenever one of its mappings\n    is modified, it writes itself to disk.\n\n    You should not use mutable values -- if you do, there's no guarantee that\n    changes made to them will be in fact written to disk. If you want to\n    ensure that changes are written to disk, use the save() method.\n\n\n    /!\\ Important note to developers: /!\\ There is now a config_version key\n    at the UserConfig's root. Whenever you change the structure of UserConfig,\n    (i.e. make changes that could cause the application to crash if UserConfig\n    got overwritten with an older version), please increase config_version by one.\n\n    This will cause pygui to erase the now-obsolete version of the file and revert\n    to default settings upon launch (the new settings will, of course, be saved).\n\n    Hopefully this will save us a lot of grief from users who update pygui\n    without reading their e-mails. Won't prevent a few problems from happening,\n    though (the whole UserConfig thing is, after all, a quick & dirty hack).\n    "
	def __init__(self, conf=None):
		if conf is not None:
			pass
		conf = {}
		self.diff_dict = dict(config_version=conf.get('config_version', -1))
		self.subs_dict = dict()
		self.notify_subs = False

	def __getitem__(self, key):
		return self.subs_dict[key]

	def get(self, key, default=None):
		return self.subs_dict.get(key, default)

	def notify_change(self, id, key, value):
		pass

	def update(self, E, **F):
		self.notify_subs = False
		for key, val in E.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		for key, val in F.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		self.notify_subs = True
		self.diff_dict.update(E, **F)
		self.save()

	def save(self):
		if 'persistence' in plugins and self.diff_dict:
			stream = open(persistent_config_path, 'wb')
			json.dump(self.diff_dict, stream)
			stream.flush()
			os.fsync(stream.fileno())
			stream.close()



user_config = UserConfig(default_conf)
]:
	i: 2381()
	o: 2614(t), 2763(f)

nname: 2381
n 2381(None)[for plug in <genexpr>(os.environ.get('PLUGINS', '').split(':')):
	if plug[0] == '-':
		plugins.discard(plug[1:])
		continue
	plugins.add(plug)
]:
	i: 2266(loop)
	o: 2480()

nname: 2266
n 2266(None)[try:
	user_configuration = os.path.join(user_config_dir, 'local_conf.py')
	_loc = {}
	execfile(user_configuration, restricted_env, _loc)
	locals().update(_loc)
	log.debug('user configuration file : %s' % user_configuration)
except IOError:
	log.info('No local configuration found.')
]:
	i: 0(try)
	o: 2381(loop)

nname: 0
n 0(None)[from __future__ import absolute_import
import os
from peewee.debug import GET_LOGGER
from peewee.version import wybox_version
import simplejson as json
log = GET_LOGGER(__name__)
version = wybox_version()
if version == 'N/A':
	DEBUG = 1
else:
	DEBUG = 0
TMP_DIR = os.getenv('TEMP', '/tmp')
no_PLAYERS = False
no_DBUS = False
fast_pushmenu = True
navigator_cache = False
socket_timeout = 20
themes_dir = '/usr/share/pygui/skins/'
locale_dir = '/usr/share/pygui/locale/'
theme_engine = 'wybox'
fps = 60
key_repeat = 3
key_q_size = 5
block_navigator = True
horizontal_selector = False
add_tv_info_banner_idle_events = False
home_order = ['*tv', 'audio', 'video_image', 'radio', 'web', 'games', 'hdmi_tv1', 'hdmi_tv2', 'image', 'video', 'net_services', 'multiverse', 'parameters', 'test_menu']
display_width, display_height = (1280, 720)
use_serialized_theme = True
default_language = None
admin_age = 100
url_list = [('Google', 'http://www.google.com'), ('WyPlay', 'http://www.wyplay.com'), ('Le Monde', 'http:www.lemonde.fr'), ('Sofinnova', 'http://www.sofinnova.fr')]
resume_video = True
resume_dvd = True
cvbs_resolution = {'pal': (720, 576, 1, 50), 'ntsc': (720, 480, 1, 59)}
random_events_sample = ('LEFT', 'RIGHT', 'UP', 'DOWN', 'HOME', 'MARKER')
random_events_duo = (('LEFT', 'RIGHT'), ('UP', 'DOWN'), ('MARKER', 'MARKER'))
output_driver = 'havana'
architecture = 'stb7100'
code_coverage = False
if False:
	pass
code_profiler = False
shutdown = True
class PluginSet(set):
	__doc__ = "This classe provides a collections of availble plugins\n    that can be loaded to modify the wybox's behavior.\n    Plugins's naming convention is '(universe|module).value'"
	def get(self, prefix=None):
		if prefix is None:
			return list(self)
		ret = set()



plugins = PluginSet(('tv', 'acquisition', 'dvd', 'wymedia', 'wyvas', 'persistence', 'youtube', 'dailymotion', 'popup_blocker', 'wifi', 'input.lirc', 'home.tv', 'home.acquisition', 'home.audio', 'home.video_image', 'home.radio', 'home.web', 'home.games', 'home.parameters', 'hand_actions.navigator', 'hand_actions.marker_navigator', 'hand_actions.player', 'hand_actions.dvd_player', 'hand_actions.tv_player', 'hand_actions.video_image_thumbnail', 'hand_actions.webbrowser', 'gui_engine.mediamenu', 'gui_engine.menu', 'gui_engine.setupparameters', 'gui_engine.tv', 'gui_engine.web', 'gui_engine.window', 'listing.fixed', 'listing.hybrid', 'listing.default', 'parameters.1.tv', 'parameters.2.videophoto', 'parameters.3.generalsetup', 'parameters.4.connections', 'parameters.5.network', 'parameters.6.advanced', 'parameters.7.version'))
import sys
user_config_dir = '/etc/'
rw_dir = '/etc/params/'
HMI_MUSIC = {'lazy_selection': 1.0, 'forward': [2, 4, 6, 10], 'backward': [-2, -4, -6, -10], 'codecs': ['wav', 'mp3', 'ogg'], 'rates': [128, 192, 256, 320], 'left': -5, 'right': 5}
HMI_VIDEO = {'lazy_selection': 0.5, 'languages': ['fr', 'en', 'de', 'es', 'pt', 'nl'], 'aspect_ratio': [0, 1], 'channels': [1, 2, 3, 6, 7], 'channel': 2, 'idle_threshold': 8, 'forward': [2, 3, 6, 12, 25, 50, 100, 300], 'backward': [-2, -3, -6, -12, -25, -50, -100, -300], 'slow': [0.20000000000000001, 0.5, 0.80000000000000004], 'reverse_slow': [0.0], 'seek_percent': 0.10000000000000001, 'seek_period': 72}
HMI_PHOTO = {'lazy_selection': 0.5, 'transitions': ['no_transition', 'fade_to_black', 'fade', 'top_slide'], 'slideshow': [15.0, 10.0, 5.0, 3.0], 'jump': 5, 'thumbnail_row_length': 5}
HMI_BASE = {'preview_delay': 0.5, 'helpbanner_duration': 5.0, 'navigator_listing_delay': 0.20000000000000001, 'search_navigator_delay': 1.3, 'volumewindow_duration': 2.0, 'error_signal_delay': 1.0, 'keyboard_truncate_prefix': '...', 'osd_languages': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'country': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'rcu_block_button0': 3.0, 'rcu_device_poll_interval': 0.014999999999999999, 'rcu_default_margin': 10, 'rcu_move_threshold': 15, 'rcu_gesture_threshold': 15.0, 'rcu_longclic_threshold': 7, 'rcu_buttons_repeat_delay': 0.14999999999999999, 'rcu_buttons_repeat_timeout': 0.14000000000000001, 'rcu_move_repeat_delay': 0.14999999999999999, 'rcu_move_repeat_timeout': 0.14000000000000001}
HMI_TV = {'banner_period': 5, 'record_banner_period': 5, 'record_duration_step': 1800, 'records_duration': [180], 'max_record_duration': 360, 'epg_margins': [0, 5, 10], 'timeshift_length': [30, 60, 120, 180], 'record_time': 7200, 'zap_time': 1.0, 'invert_y_axis': 0}
HMI_VIDEO['forward'] = [2, 8, 25, 100, 300]
HMI_VIDEO['backward'] = [-2, -8, -25, -100, -300]
log.debug('HMI dicts created')
restore_previous_config = True
if not default_language:
	pass
default_conf = {'config_version': 18, 'connections': {'resolution': '1280:720:0:50', 'active_device': 'hdmi', 'composite_output': 'pal', 'component_output': 'rgb', 'hdmi_sound': False, 'auto_frame_rate': False, 'spdif_surround': False, 'scart1_io_mode': 'out', 'scart1_in_mode': 'composite', 'scart1_out_mode': 'rgb', 'scart2_io_mode': 'in', 'scart2_in_mode': 'rgb', 'scart2_out_mode': 's-video'}, 'video': {'language': HMI_VIDEO['languages'][0], 'aspect_ratio': HMI_VIDEO['aspect_ratio'][0], 'display_format': 'letter_box', 'channel': HMI_VIDEO['channels'][0], 'dvdmenulanguage': HMI_VIDEO['languages'][0], 'dvdmovielanguage': HMI_VIDEO['languages'][0], 'dvdsubtitlelanguage': HMI_VIDEO['languages'][0], 'dvdbrowse': False, 'dvdautolaunch': False, 'dvdprotectionlevel': 0, 'dvdchannel': HMI_VIDEO['channels'][0], 'subtitlesfiles': False}, 'music': {'ripcodec': HMI_MUSIC['codecs'][0], 'riprate': HMI_MUSIC['rates'][1], 'autorip': False}, 'photo': {'filename': True, 'zoom': False, 'transition': HMI_PHOTO['transitions'][0], 'period': HMI_PHOTO['slideshow'][0]}, 'tv': {'record_duration': HMI_TV['records_duration'][0], 'max_record_duration': HMI_TV['max_record_duration'], 'epg_margin': HMI_TV['epg_margins'][1], 'timeshift_length': HMI_TV['timeshift_length'][-1], 'lnb_high_voltage': False, 'last_scan_time': 0, 'scan_with_scrambled': True, 'last_channel_index': None, 'last_favorite_name': u'all_channels_list'}, 'base': {'help_banner': 1, 'country': HMI_BASE['country'][0], 'language': default_language, 'timeupdatemode': 3, 'timeformat': 1, 'dateformat': 0, 'timezone': 'Europe/Paris', 'firstboot': True}, 'security': {'secretcode': None, 'parent_mode': True, 'parental_control': False, 'show_hidden': True, 'question': None, 'answer': None, 'maturity_rating': 0}, 'power': {'screensaver_type': 'image', 'screensaver_threshold': 300}, 'sound': {'volume': 10, 'mute': 0}, 'network': {'type': 'wired', 'iface': 'eth0', 'upnp': True, 'wifi_name': None, 'wifi_security': None, 'wifi_key': None}, 'advanced': {'start_on_demo_mode': False, 'last_universe': None, 'demo_mode': False}, 'net': {'login': None, 'password': None}}
restricted_env = {'__builtins__': None, 'plugins': plugins, 'True': True, 'False': False, 'HMI_BASE': HMI_BASE, 'HMI_VIDEO': HMI_VIDEO, 'HMI_MUSIC': HMI_MUSIC, 'HMI_PHOTO': HMI_PHOTO, 'HMI_TV': HMI_TV}
]:
	i: 
	o: 2266(try)

nname: 2777
n 2777(None)[]:
	i: 2763(), 2614(f)
	o: 

nname: 2763
n 2763(None)[log.warn('Configuration persistence disabled. Using default values.')
]:
	i: 2381(f)
	o: 2777()

nname: 2614
n 2614(None)[try:
	rw_config = json.load(open(persistent_config_path))
	if user_config['config_version'] == rw_config.get('config_version', -1):
		user_config.update(rw_config)
		log.info('System configuration from a previous session found and loaded.')
	else:
		log.warn('Previous system configuration found with an incompatible schema. Discarding it.')
		os.unlink(persistent_config_path)
except Exception:
	log.warn('Unable to load persistent system configuration. Using default values.')
]:
	i: 2381(t)
	o: 2777(JA)

nname: 2381
n 2381('persistence' in plugins)[for plug in <genexpr>(os.environ.get('PLUGINS', '').split(':')):
	if plug[0] == '-':
		plugins.discard(plug[1:])
		continue
	plugins.add(plug)
persistent_config_path = '/etc/params/wy_config'
import platform
if platform.machine() != 'sh4':
	output_driver = 'dummy'
	architecture = 'pc'
	plugins.discard('persistence')
class _SubDict(dict):
	def __init__(self, values, key, parent):
		dict.__init__(self, values)
		self.key = key
		self.parent = parent

	def __setitem__(self, key, value):
		if key == 'resolution' and self.key == 'connections' and isinstance(value, (tuple, list)):
			value = ':'.join(map(str, value))
			dict.__setitem__(self, key, value)
		else:
			dict.__setitem__(self, key, value)
		if self.parent.notify_subs:
			self.parent.notify_change(self.key, key, value)

	def __getitem__(self, key):
		if key == 'resolution' and self.key == 'connections':
			return tuple(map(int, dict.__getitem__(self, key).split(':')))
		else:
			return dict.__getitem__(self, key)



class UserConfig(object):
	__doc__ = "User configuration storage class. Used to store preferences that\n    should be restored after relaunching pygui.\n\n    This class behaves like a dict, except that whenever one of its mappings\n    is modified, it writes itself to disk.\n\n    You should not use mutable values -- if you do, there's no guarantee that\n    changes made to them will be in fact written to disk. If you want to\n    ensure that changes are written to disk, use the save() method.\n\n\n    /!\\ Important note to developers: /!\\ There is now a config_version key\n    at the UserConfig's root. Whenever you change the structure of UserConfig,\n    (i.e. make changes that could cause the application to crash if UserConfig\n    got overwritten with an older version), please increase config_version by one.\n\n    This will cause pygui to erase the now-obsolete version of the file and revert\n    to default settings upon launch (the new settings will, of course, be saved).\n\n    Hopefully this will save us a lot of grief from users who update pygui\n    without reading their e-mails. Won't prevent a few problems from happening,\n    though (the whole UserConfig thing is, after all, a quick & dirty hack).\n    "
	def __init__(self, conf=None):
		if conf is not None:
			pass
		conf = {}
		self.diff_dict = dict(config_version=conf.get('config_version', -1))
		self.subs_dict = dict()
		self.notify_subs = False

	def __getitem__(self, key):
		return self.subs_dict[key]

	def get(self, key, default=None):
		return self.subs_dict.get(key, default)

	def notify_change(self, id, key, value):
		pass

	def update(self, E, **F):
		self.notify_subs = False
		for key, val in E.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		for key, val in F.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		self.notify_subs = True
		self.diff_dict.update(E, **F)
		self.save()

	def save(self):
		if 'persistence' in plugins and self.diff_dict:
			stream = open(persistent_config_path, 'wb')
			json.dump(self.diff_dict, stream)
			stream.flush()
			os.fsync(stream.fileno())
			stream.close()



user_config = UserConfig(default_conf)
]:
	i: 0(loop)
	o: 2614(t), 2763(f)

nname: 0
n 0(None)[from __future__ import absolute_import
import os
from peewee.debug import GET_LOGGER
from peewee.version import wybox_version
import simplejson as json
log = GET_LOGGER(__name__)
version = wybox_version()
if version == 'N/A':
	DEBUG = 1
else:
	DEBUG = 0
TMP_DIR = os.getenv('TEMP', '/tmp')
no_PLAYERS = False
no_DBUS = False
fast_pushmenu = True
navigator_cache = False
socket_timeout = 20
themes_dir = '/usr/share/pygui/skins/'
locale_dir = '/usr/share/pygui/locale/'
theme_engine = 'wybox'
fps = 60
key_repeat = 3
key_q_size = 5
block_navigator = True
horizontal_selector = False
add_tv_info_banner_idle_events = False
home_order = ['*tv', 'audio', 'video_image', 'radio', 'web', 'games', 'hdmi_tv1', 'hdmi_tv2', 'image', 'video', 'net_services', 'multiverse', 'parameters', 'test_menu']
display_width, display_height = (1280, 720)
use_serialized_theme = True
default_language = None
admin_age = 100
url_list = [('Google', 'http://www.google.com'), ('WyPlay', 'http://www.wyplay.com'), ('Le Monde', 'http:www.lemonde.fr'), ('Sofinnova', 'http://www.sofinnova.fr')]
resume_video = True
resume_dvd = True
cvbs_resolution = {'pal': (720, 576, 1, 50), 'ntsc': (720, 480, 1, 59)}
random_events_sample = ('LEFT', 'RIGHT', 'UP', 'DOWN', 'HOME', 'MARKER')
random_events_duo = (('LEFT', 'RIGHT'), ('UP', 'DOWN'), ('MARKER', 'MARKER'))
output_driver = 'havana'
architecture = 'stb7100'
code_coverage = False
if False:
	pass
code_profiler = False
shutdown = True
class PluginSet(set):
	__doc__ = "This classe provides a collections of availble plugins\n    that can be loaded to modify the wybox's behavior.\n    Plugins's naming convention is '(universe|module).value'"
	def get(self, prefix=None):
		if prefix is None:
			return list(self)
		ret = set()



plugins = PluginSet(('tv', 'acquisition', 'dvd', 'wymedia', 'wyvas', 'persistence', 'youtube', 'dailymotion', 'popup_blocker', 'wifi', 'input.lirc', 'home.tv', 'home.acquisition', 'home.audio', 'home.video_image', 'home.radio', 'home.web', 'home.games', 'home.parameters', 'hand_actions.navigator', 'hand_actions.marker_navigator', 'hand_actions.player', 'hand_actions.dvd_player', 'hand_actions.tv_player', 'hand_actions.video_image_thumbnail', 'hand_actions.webbrowser', 'gui_engine.mediamenu', 'gui_engine.menu', 'gui_engine.setupparameters', 'gui_engine.tv', 'gui_engine.web', 'gui_engine.window', 'listing.fixed', 'listing.hybrid', 'listing.default', 'parameters.1.tv', 'parameters.2.videophoto', 'parameters.3.generalsetup', 'parameters.4.connections', 'parameters.5.network', 'parameters.6.advanced', 'parameters.7.version'))
import sys
user_config_dir = '/etc/'
rw_dir = '/etc/params/'
HMI_MUSIC = {'lazy_selection': 1.0, 'forward': [2, 4, 6, 10], 'backward': [-2, -4, -6, -10], 'codecs': ['wav', 'mp3', 'ogg'], 'rates': [128, 192, 256, 320], 'left': -5, 'right': 5}
HMI_VIDEO = {'lazy_selection': 0.5, 'languages': ['fr', 'en', 'de', 'es', 'pt', 'nl'], 'aspect_ratio': [0, 1], 'channels': [1, 2, 3, 6, 7], 'channel': 2, 'idle_threshold': 8, 'forward': [2, 3, 6, 12, 25, 50, 100, 300], 'backward': [-2, -3, -6, -12, -25, -50, -100, -300], 'slow': [0.20000000000000001, 0.5, 0.80000000000000004], 'reverse_slow': [0.0], 'seek_percent': 0.10000000000000001, 'seek_period': 72}
HMI_PHOTO = {'lazy_selection': 0.5, 'transitions': ['no_transition', 'fade_to_black', 'fade', 'top_slide'], 'slideshow': [15.0, 10.0, 5.0, 3.0], 'jump': 5, 'thumbnail_row_length': 5}
HMI_BASE = {'preview_delay': 0.5, 'helpbanner_duration': 5.0, 'navigator_listing_delay': 0.20000000000000001, 'search_navigator_delay': 1.3, 'volumewindow_duration': 2.0, 'error_signal_delay': 1.0, 'keyboard_truncate_prefix': '...', 'osd_languages': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'country': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'rcu_block_button0': 3.0, 'rcu_device_poll_interval': 0.014999999999999999, 'rcu_default_margin': 10, 'rcu_move_threshold': 15, 'rcu_gesture_threshold': 15.0, 'rcu_longclic_threshold': 7, 'rcu_buttons_repeat_delay': 0.14999999999999999, 'rcu_buttons_repeat_timeout': 0.14000000000000001, 'rcu_move_repeat_delay': 0.14999999999999999, 'rcu_move_repeat_timeout': 0.14000000000000001}
HMI_TV = {'banner_period': 5, 'record_banner_period': 5, 'record_duration_step': 1800, 'records_duration': [180], 'max_record_duration': 360, 'epg_margins': [0, 5, 10], 'timeshift_length': [30, 60, 120, 180], 'record_time': 7200, 'zap_time': 1.0, 'invert_y_axis': 0}
HMI_VIDEO['forward'] = [2, 8, 25, 100, 300]
HMI_VIDEO['backward'] = [-2, -8, -25, -100, -300]
log.debug('HMI dicts created')
restore_previous_config = True
if not default_language:
	pass
default_conf = {'config_version': 18, 'connections': {'resolution': '1280:720:0:50', 'active_device': 'hdmi', 'composite_output': 'pal', 'component_output': 'rgb', 'hdmi_sound': False, 'auto_frame_rate': False, 'spdif_surround': False, 'scart1_io_mode': 'out', 'scart1_in_mode': 'composite', 'scart1_out_mode': 'rgb', 'scart2_io_mode': 'in', 'scart2_in_mode': 'rgb', 'scart2_out_mode': 's-video'}, 'video': {'language': HMI_VIDEO['languages'][0], 'aspect_ratio': HMI_VIDEO['aspect_ratio'][0], 'display_format': 'letter_box', 'channel': HMI_VIDEO['channels'][0], 'dvdmenulanguage': HMI_VIDEO['languages'][0], 'dvdmovielanguage': HMI_VIDEO['languages'][0], 'dvdsubtitlelanguage': HMI_VIDEO['languages'][0], 'dvdbrowse': False, 'dvdautolaunch': False, 'dvdprotectionlevel': 0, 'dvdchannel': HMI_VIDEO['channels'][0], 'subtitlesfiles': False}, 'music': {'ripcodec': HMI_MUSIC['codecs'][0], 'riprate': HMI_MUSIC['rates'][1], 'autorip': False}, 'photo': {'filename': True, 'zoom': False, 'transition': HMI_PHOTO['transitions'][0], 'period': HMI_PHOTO['slideshow'][0]}, 'tv': {'record_duration': HMI_TV['records_duration'][0], 'max_record_duration': HMI_TV['max_record_duration'], 'epg_margin': HMI_TV['epg_margins'][1], 'timeshift_length': HMI_TV['timeshift_length'][-1], 'lnb_high_voltage': False, 'last_scan_time': 0, 'scan_with_scrambled': True, 'last_channel_index': None, 'last_favorite_name': u'all_channels_list'}, 'base': {'help_banner': 1, 'country': HMI_BASE['country'][0], 'language': default_language, 'timeupdatemode': 3, 'timeformat': 1, 'dateformat': 0, 'timezone': 'Europe/Paris', 'firstboot': True}, 'security': {'secretcode': None, 'parent_mode': True, 'parental_control': False, 'show_hidden': True, 'question': None, 'answer': None, 'maturity_rating': 0}, 'power': {'screensaver_type': 'image', 'screensaver_threshold': 300}, 'sound': {'volume': 10, 'mute': 0}, 'network': {'type': 'wired', 'iface': 'eth0', 'upnp': True, 'wifi_name': None, 'wifi_security': None, 'wifi_key': None}, 'advanced': {'start_on_demo_mode': False, 'last_universe': None, 'demo_mode': False}, 'net': {'login': None, 'password': None}}
restricted_env = {'__builtins__': None, 'plugins': plugins, 'True': True, 'False': False, 'HMI_BASE': HMI_BASE, 'HMI_VIDEO': HMI_VIDEO, 'HMI_MUSIC': HMI_MUSIC, 'HMI_PHOTO': HMI_PHOTO, 'HMI_TV': HMI_TV}
try:
	user_configuration = os.path.join(user_config_dir, 'local_conf.py')
	_loc = {}
	execfile(user_configuration, restricted_env, _loc)
	locals().update(_loc)
	log.debug('user configuration file : %s' % user_configuration)
except IOError:
	log.info('No local configuration found.')
]:
	i: 
	o: 2381(loop)

nname: 2777
n 2777(None)[]:
	i: 0(f)
	o: 

nname: 0
n 0(None)[from __future__ import absolute_import
import os
from peewee.debug import GET_LOGGER
from peewee.version import wybox_version
import simplejson as json
log = GET_LOGGER(__name__)
version = wybox_version()
if version == 'N/A':
	DEBUG = 1
else:
	DEBUG = 0
TMP_DIR = os.getenv('TEMP', '/tmp')
no_PLAYERS = False
no_DBUS = False
fast_pushmenu = True
navigator_cache = False
socket_timeout = 20
themes_dir = '/usr/share/pygui/skins/'
locale_dir = '/usr/share/pygui/locale/'
theme_engine = 'wybox'
fps = 60
key_repeat = 3
key_q_size = 5
block_navigator = True
horizontal_selector = False
add_tv_info_banner_idle_events = False
home_order = ['*tv', 'audio', 'video_image', 'radio', 'web', 'games', 'hdmi_tv1', 'hdmi_tv2', 'image', 'video', 'net_services', 'multiverse', 'parameters', 'test_menu']
display_width, display_height = (1280, 720)
use_serialized_theme = True
default_language = None
admin_age = 100
url_list = [('Google', 'http://www.google.com'), ('WyPlay', 'http://www.wyplay.com'), ('Le Monde', 'http:www.lemonde.fr'), ('Sofinnova', 'http://www.sofinnova.fr')]
resume_video = True
resume_dvd = True
cvbs_resolution = {'pal': (720, 576, 1, 50), 'ntsc': (720, 480, 1, 59)}
random_events_sample = ('LEFT', 'RIGHT', 'UP', 'DOWN', 'HOME', 'MARKER')
random_events_duo = (('LEFT', 'RIGHT'), ('UP', 'DOWN'), ('MARKER', 'MARKER'))
output_driver = 'havana'
architecture = 'stb7100'
code_coverage = False
if False:
	pass
code_profiler = False
shutdown = True
class PluginSet(set):
	__doc__ = "This classe provides a collections of availble plugins\n    that can be loaded to modify the wybox's behavior.\n    Plugins's naming convention is '(universe|module).value'"
	def get(self, prefix=None):
		if prefix is None:
			return list(self)
		ret = set()



plugins = PluginSet(('tv', 'acquisition', 'dvd', 'wymedia', 'wyvas', 'persistence', 'youtube', 'dailymotion', 'popup_blocker', 'wifi', 'input.lirc', 'home.tv', 'home.acquisition', 'home.audio', 'home.video_image', 'home.radio', 'home.web', 'home.games', 'home.parameters', 'hand_actions.navigator', 'hand_actions.marker_navigator', 'hand_actions.player', 'hand_actions.dvd_player', 'hand_actions.tv_player', 'hand_actions.video_image_thumbnail', 'hand_actions.webbrowser', 'gui_engine.mediamenu', 'gui_engine.menu', 'gui_engine.setupparameters', 'gui_engine.tv', 'gui_engine.web', 'gui_engine.window', 'listing.fixed', 'listing.hybrid', 'listing.default', 'parameters.1.tv', 'parameters.2.videophoto', 'parameters.3.generalsetup', 'parameters.4.connections', 'parameters.5.network', 'parameters.6.advanced', 'parameters.7.version'))
import sys
user_config_dir = '/etc/'
rw_dir = '/etc/params/'
HMI_MUSIC = {'lazy_selection': 1.0, 'forward': [2, 4, 6, 10], 'backward': [-2, -4, -6, -10], 'codecs': ['wav', 'mp3', 'ogg'], 'rates': [128, 192, 256, 320], 'left': -5, 'right': 5}
HMI_VIDEO = {'lazy_selection': 0.5, 'languages': ['fr', 'en', 'de', 'es', 'pt', 'nl'], 'aspect_ratio': [0, 1], 'channels': [1, 2, 3, 6, 7], 'channel': 2, 'idle_threshold': 8, 'forward': [2, 3, 6, 12, 25, 50, 100, 300], 'backward': [-2, -3, -6, -12, -25, -50, -100, -300], 'slow': [0.20000000000000001, 0.5, 0.80000000000000004], 'reverse_slow': [0.0], 'seek_percent': 0.10000000000000001, 'seek_period': 72}
HMI_PHOTO = {'lazy_selection': 0.5, 'transitions': ['no_transition', 'fade_to_black', 'fade', 'top_slide'], 'slideshow': [15.0, 10.0, 5.0, 3.0], 'jump': 5, 'thumbnail_row_length': 5}
HMI_BASE = {'preview_delay': 0.5, 'helpbanner_duration': 5.0, 'navigator_listing_delay': 0.20000000000000001, 'search_navigator_delay': 1.3, 'volumewindow_duration': 2.0, 'error_signal_delay': 1.0, 'keyboard_truncate_prefix': '...', 'osd_languages': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'country': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'rcu_block_button0': 3.0, 'rcu_device_poll_interval': 0.014999999999999999, 'rcu_default_margin': 10, 'rcu_move_threshold': 15, 'rcu_gesture_threshold': 15.0, 'rcu_longclic_threshold': 7, 'rcu_buttons_repeat_delay': 0.14999999999999999, 'rcu_buttons_repeat_timeout': 0.14000000000000001, 'rcu_move_repeat_delay': 0.14999999999999999, 'rcu_move_repeat_timeout': 0.14000000000000001}
HMI_TV = {'banner_period': 5, 'record_banner_period': 5, 'record_duration_step': 1800, 'records_duration': [180], 'max_record_duration': 360, 'epg_margins': [0, 5, 10], 'timeshift_length': [30, 60, 120, 180], 'record_time': 7200, 'zap_time': 1.0, 'invert_y_axis': 0}
HMI_VIDEO['forward'] = [2, 8, 25, 100, 300]
HMI_VIDEO['backward'] = [-2, -8, -25, -100, -300]
log.debug('HMI dicts created')
restore_previous_config = True
if not default_language:
	pass
default_conf = {'config_version': 18, 'connections': {'resolution': '1280:720:0:50', 'active_device': 'hdmi', 'composite_output': 'pal', 'component_output': 'rgb', 'hdmi_sound': False, 'auto_frame_rate': False, 'spdif_surround': False, 'scart1_io_mode': 'out', 'scart1_in_mode': 'composite', 'scart1_out_mode': 'rgb', 'scart2_io_mode': 'in', 'scart2_in_mode': 'rgb', 'scart2_out_mode': 's-video'}, 'video': {'language': HMI_VIDEO['languages'][0], 'aspect_ratio': HMI_VIDEO['aspect_ratio'][0], 'display_format': 'letter_box', 'channel': HMI_VIDEO['channels'][0], 'dvdmenulanguage': HMI_VIDEO['languages'][0], 'dvdmovielanguage': HMI_VIDEO['languages'][0], 'dvdsubtitlelanguage': HMI_VIDEO['languages'][0], 'dvdbrowse': False, 'dvdautolaunch': False, 'dvdprotectionlevel': 0, 'dvdchannel': HMI_VIDEO['channels'][0], 'subtitlesfiles': False}, 'music': {'ripcodec': HMI_MUSIC['codecs'][0], 'riprate': HMI_MUSIC['rates'][1], 'autorip': False}, 'photo': {'filename': True, 'zoom': False, 'transition': HMI_PHOTO['transitions'][0], 'period': HMI_PHOTO['slideshow'][0]}, 'tv': {'record_duration': HMI_TV['records_duration'][0], 'max_record_duration': HMI_TV['max_record_duration'], 'epg_margin': HMI_TV['epg_margins'][1], 'timeshift_length': HMI_TV['timeshift_length'][-1], 'lnb_high_voltage': False, 'last_scan_time': 0, 'scan_with_scrambled': True, 'last_channel_index': None, 'last_favorite_name': u'all_channels_list'}, 'base': {'help_banner': 1, 'country': HMI_BASE['country'][0], 'language': default_language, 'timeupdatemode': 3, 'timeformat': 1, 'dateformat': 0, 'timezone': 'Europe/Paris', 'firstboot': True}, 'security': {'secretcode': None, 'parent_mode': True, 'parental_control': False, 'show_hidden': True, 'question': None, 'answer': None, 'maturity_rating': 0}, 'power': {'screensaver_type': 'image', 'screensaver_threshold': 300}, 'sound': {'volume': 10, 'mute': 0}, 'network': {'type': 'wired', 'iface': 'eth0', 'upnp': True, 'wifi_name': None, 'wifi_security': None, 'wifi_key': None}, 'advanced': {'start_on_demo_mode': False, 'last_universe': None, 'demo_mode': False}, 'net': {'login': None, 'password': None}}
restricted_env = {'__builtins__': None, 'plugins': plugins, 'True': True, 'False': False, 'HMI_BASE': HMI_BASE, 'HMI_VIDEO': HMI_VIDEO, 'HMI_MUSIC': HMI_MUSIC, 'HMI_PHOTO': HMI_PHOTO, 'HMI_TV': HMI_TV}
try:
	user_configuration = os.path.join(user_config_dir, 'local_conf.py')
	_loc = {}
	execfile(user_configuration, restricted_env, _loc)
	locals().update(_loc)
	log.debug('user configuration file : %s' % user_configuration)
except IOError:
	log.info('No local configuration found.')
for plug in <genexpr>(os.environ.get('PLUGINS', '').split(':')):
	if plug[0] == '-':
		plugins.discard(plug[1:])
		continue
	plugins.add(plug)
persistent_config_path = '/etc/params/wy_config'
import platform
if platform.machine() != 'sh4':
	output_driver = 'dummy'
	architecture = 'pc'
	plugins.discard('persistence')
class _SubDict(dict):
	def __init__(self, values, key, parent):
		dict.__init__(self, values)
		self.key = key
		self.parent = parent

	def __setitem__(self, key, value):
		if key == 'resolution' and self.key == 'connections' and isinstance(value, (tuple, list)):
			value = ':'.join(map(str, value))
			dict.__setitem__(self, key, value)
		else:
			dict.__setitem__(self, key, value)
		if self.parent.notify_subs:
			self.parent.notify_change(self.key, key, value)

	def __getitem__(self, key):
		if key == 'resolution' and self.key == 'connections':
			return tuple(map(int, dict.__getitem__(self, key).split(':')))
		else:
			return dict.__getitem__(self, key)



class UserConfig(object):
	__doc__ = "User configuration storage class. Used to store preferences that\n    should be restored after relaunching pygui.\n\n    This class behaves like a dict, except that whenever one of its mappings\n    is modified, it writes itself to disk.\n\n    You should not use mutable values -- if you do, there's no guarantee that\n    changes made to them will be in fact written to disk. If you want to\n    ensure that changes are written to disk, use the save() method.\n\n\n    /!\\ Important note to developers: /!\\ There is now a config_version key\n    at the UserConfig's root. Whenever you change the structure of UserConfig,\n    (i.e. make changes that could cause the application to crash if UserConfig\n    got overwritten with an older version), please increase config_version by one.\n\n    This will cause pygui to erase the now-obsolete version of the file and revert\n    to default settings upon launch (the new settings will, of course, be saved).\n\n    Hopefully this will save us a lot of grief from users who update pygui\n    without reading their e-mails. Won't prevent a few problems from happening,\n    though (the whole UserConfig thing is, after all, a quick & dirty hack).\n    "
	def __init__(self, conf=None):
		if conf is not None:
			pass
		conf = {}
		self.diff_dict = dict(config_version=conf.get('config_version', -1))
		self.subs_dict = dict()
		self.notify_subs = False

	def __getitem__(self, key):
		return self.subs_dict[key]

	def get(self, key, default=None):
		return self.subs_dict.get(key, default)

	def notify_change(self, id, key, value):
		pass

	def update(self, E, **F):
		self.notify_subs = False
		for key, val in E.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		for key, val in F.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		self.notify_subs = True
		self.diff_dict.update(E, **F)
		self.save()

	def save(self):
		if 'persistence' in plugins and self.diff_dict:
			stream = open(persistent_config_path, 'wb')
			json.dump(self.diff_dict, stream)
			stream.flush()
			os.fsync(stream.fileno())
			stream.close()



user_config = UserConfig(default_conf)
if 'persistence' in plugins:
	try:
		rw_config = json.load(open(persistent_config_path))
		if user_config['config_version'] == rw_config.get('config_version', -1):
			user_config.update(rw_config)
			log.info('System configuration from a previous session found and loaded.')
		else:
			log.warn('Previous system configuration found with an incompatible schema. Discarding it.')
			os.unlink(persistent_config_path)
	except Exception:
		log.warn('Unable to load persistent system configuration. Using default values.')
else:
	log.warn('Configuration persistence disabled. Using default values.')
]:
	i: 
	o: 2777(JA)

nname: 0
n 0(None)[from __future__ import absolute_import
import os
from peewee.debug import GET_LOGGER
from peewee.version import wybox_version
import simplejson as json
log = GET_LOGGER(__name__)
version = wybox_version()
if version == 'N/A':
	DEBUG = 1
else:
	DEBUG = 0
TMP_DIR = os.getenv('TEMP', '/tmp')
no_PLAYERS = False
no_DBUS = False
fast_pushmenu = True
navigator_cache = False
socket_timeout = 20
themes_dir = '/usr/share/pygui/skins/'
locale_dir = '/usr/share/pygui/locale/'
theme_engine = 'wybox'
fps = 60
key_repeat = 3
key_q_size = 5
block_navigator = True
horizontal_selector = False
add_tv_info_banner_idle_events = False
home_order = ['*tv', 'audio', 'video_image', 'radio', 'web', 'games', 'hdmi_tv1', 'hdmi_tv2', 'image', 'video', 'net_services', 'multiverse', 'parameters', 'test_menu']
display_width, display_height = (1280, 720)
use_serialized_theme = True
default_language = None
admin_age = 100
url_list = [('Google', 'http://www.google.com'), ('WyPlay', 'http://www.wyplay.com'), ('Le Monde', 'http:www.lemonde.fr'), ('Sofinnova', 'http://www.sofinnova.fr')]
resume_video = True
resume_dvd = True
cvbs_resolution = {'pal': (720, 576, 1, 50), 'ntsc': (720, 480, 1, 59)}
random_events_sample = ('LEFT', 'RIGHT', 'UP', 'DOWN', 'HOME', 'MARKER')
random_events_duo = (('LEFT', 'RIGHT'), ('UP', 'DOWN'), ('MARKER', 'MARKER'))
output_driver = 'havana'
architecture = 'stb7100'
code_coverage = False
if False:
	pass
code_profiler = False
shutdown = True
class PluginSet(set):
	__doc__ = "This classe provides a collections of availble plugins\n    that can be loaded to modify the wybox's behavior.\n    Plugins's naming convention is '(universe|module).value'"
	def get(self, prefix=None):
		if prefix is None:
			return list(self)
		ret = set()



plugins = PluginSet(('tv', 'acquisition', 'dvd', 'wymedia', 'wyvas', 'persistence', 'youtube', 'dailymotion', 'popup_blocker', 'wifi', 'input.lirc', 'home.tv', 'home.acquisition', 'home.audio', 'home.video_image', 'home.radio', 'home.web', 'home.games', 'home.parameters', 'hand_actions.navigator', 'hand_actions.marker_navigator', 'hand_actions.player', 'hand_actions.dvd_player', 'hand_actions.tv_player', 'hand_actions.video_image_thumbnail', 'hand_actions.webbrowser', 'gui_engine.mediamenu', 'gui_engine.menu', 'gui_engine.setupparameters', 'gui_engine.tv', 'gui_engine.web', 'gui_engine.window', 'listing.fixed', 'listing.hybrid', 'listing.default', 'parameters.1.tv', 'parameters.2.videophoto', 'parameters.3.generalsetup', 'parameters.4.connections', 'parameters.5.network', 'parameters.6.advanced', 'parameters.7.version'))
import sys
user_config_dir = '/etc/'
rw_dir = '/etc/params/'
HMI_MUSIC = {'lazy_selection': 1.0, 'forward': [2, 4, 6, 10], 'backward': [-2, -4, -6, -10], 'codecs': ['wav', 'mp3', 'ogg'], 'rates': [128, 192, 256, 320], 'left': -5, 'right': 5}
HMI_VIDEO = {'lazy_selection': 0.5, 'languages': ['fr', 'en', 'de', 'es', 'pt', 'nl'], 'aspect_ratio': [0, 1], 'channels': [1, 2, 3, 6, 7], 'channel': 2, 'idle_threshold': 8, 'forward': [2, 3, 6, 12, 25, 50, 100, 300], 'backward': [-2, -3, -6, -12, -25, -50, -100, -300], 'slow': [0.20000000000000001, 0.5, 0.80000000000000004], 'reverse_slow': [0.0], 'seek_percent': 0.10000000000000001, 'seek_period': 72}
HMI_PHOTO = {'lazy_selection': 0.5, 'transitions': ['no_transition', 'fade_to_black', 'fade', 'top_slide'], 'slideshow': [15.0, 10.0, 5.0, 3.0], 'jump': 5, 'thumbnail_row_length': 5}
HMI_BASE = {'preview_delay': 0.5, 'helpbanner_duration': 5.0, 'navigator_listing_delay': 0.20000000000000001, 'search_navigator_delay': 1.3, 'volumewindow_duration': 2.0, 'error_signal_delay': 1.0, 'keyboard_truncate_prefix': '...', 'osd_languages': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'country': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'rcu_block_button0': 3.0, 'rcu_device_poll_interval': 0.014999999999999999, 'rcu_default_margin': 10, 'rcu_move_threshold': 15, 'rcu_gesture_threshold': 15.0, 'rcu_longclic_threshold': 7, 'rcu_buttons_repeat_delay': 0.14999999999999999, 'rcu_buttons_repeat_timeout': 0.14000000000000001, 'rcu_move_repeat_delay': 0.14999999999999999, 'rcu_move_repeat_timeout': 0.14000000000000001}
HMI_TV = {'banner_period': 5, 'record_banner_period': 5, 'record_duration_step': 1800, 'records_duration': [180], 'max_record_duration': 360, 'epg_margins': [0, 5, 10], 'timeshift_length': [30, 60, 120, 180], 'record_time': 7200, 'zap_time': 1.0, 'invert_y_axis': 0}
HMI_VIDEO['forward'] = [2, 8, 25, 100, 300]
HMI_VIDEO['backward'] = [-2, -8, -25, -100, -300]
log.debug('HMI dicts created')
restore_previous_config = True
if not default_language:
	pass
default_conf = {'config_version': 18, 'connections': {'resolution': '1280:720:0:50', 'active_device': 'hdmi', 'composite_output': 'pal', 'component_output': 'rgb', 'hdmi_sound': False, 'auto_frame_rate': False, 'spdif_surround': False, 'scart1_io_mode': 'out', 'scart1_in_mode': 'composite', 'scart1_out_mode': 'rgb', 'scart2_io_mode': 'in', 'scart2_in_mode': 'rgb', 'scart2_out_mode': 's-video'}, 'video': {'language': HMI_VIDEO['languages'][0], 'aspect_ratio': HMI_VIDEO['aspect_ratio'][0], 'display_format': 'letter_box', 'channel': HMI_VIDEO['channels'][0], 'dvdmenulanguage': HMI_VIDEO['languages'][0], 'dvdmovielanguage': HMI_VIDEO['languages'][0], 'dvdsubtitlelanguage': HMI_VIDEO['languages'][0], 'dvdbrowse': False, 'dvdautolaunch': False, 'dvdprotectionlevel': 0, 'dvdchannel': HMI_VIDEO['channels'][0], 'subtitlesfiles': False}, 'music': {'ripcodec': HMI_MUSIC['codecs'][0], 'riprate': HMI_MUSIC['rates'][1], 'autorip': False}, 'photo': {'filename': True, 'zoom': False, 'transition': HMI_PHOTO['transitions'][0], 'period': HMI_PHOTO['slideshow'][0]}, 'tv': {'record_duration': HMI_TV['records_duration'][0], 'max_record_duration': HMI_TV['max_record_duration'], 'epg_margin': HMI_TV['epg_margins'][1], 'timeshift_length': HMI_TV['timeshift_length'][-1], 'lnb_high_voltage': False, 'last_scan_time': 0, 'scan_with_scrambled': True, 'last_channel_index': None, 'last_favorite_name': u'all_channels_list'}, 'base': {'help_banner': 1, 'country': HMI_BASE['country'][0], 'language': default_language, 'timeupdatemode': 3, 'timeformat': 1, 'dateformat': 0, 'timezone': 'Europe/Paris', 'firstboot': True}, 'security': {'secretcode': None, 'parent_mode': True, 'parental_control': False, 'show_hidden': True, 'question': None, 'answer': None, 'maturity_rating': 0}, 'power': {'screensaver_type': 'image', 'screensaver_threshold': 300}, 'sound': {'volume': 10, 'mute': 0}, 'network': {'type': 'wired', 'iface': 'eth0', 'upnp': True, 'wifi_name': None, 'wifi_security': None, 'wifi_key': None}, 'advanced': {'start_on_demo_mode': False, 'last_universe': None, 'demo_mode': False}, 'net': {'login': None, 'password': None}}
restricted_env = {'__builtins__': None, 'plugins': plugins, 'True': True, 'False': False, 'HMI_BASE': HMI_BASE, 'HMI_VIDEO': HMI_VIDEO, 'HMI_MUSIC': HMI_MUSIC, 'HMI_PHOTO': HMI_PHOTO, 'HMI_TV': HMI_TV}
try:
	user_configuration = os.path.join(user_config_dir, 'local_conf.py')
	_loc = {}
	execfile(user_configuration, restricted_env, _loc)
	locals().update(_loc)
	log.debug('user configuration file : %s' % user_configuration)
except IOError:
	log.info('No local configuration found.')
for plug in <genexpr>(os.environ.get('PLUGINS', '').split(':')):
	if plug[0] == '-':
		plugins.discard(plug[1:])
		continue
	plugins.add(plug)
persistent_config_path = '/etc/params/wy_config'
import platform
if platform.machine() != 'sh4':
	output_driver = 'dummy'
	architecture = 'pc'
	plugins.discard('persistence')
class _SubDict(dict):
	def __init__(self, values, key, parent):
		dict.__init__(self, values)
		self.key = key
		self.parent = parent

	def __setitem__(self, key, value):
		if key == 'resolution' and self.key == 'connections' and isinstance(value, (tuple, list)):
			value = ':'.join(map(str, value))
			dict.__setitem__(self, key, value)
		else:
			dict.__setitem__(self, key, value)
		if self.parent.notify_subs:
			self.parent.notify_change(self.key, key, value)

	def __getitem__(self, key):
		if key == 'resolution' and self.key == 'connections':
			return tuple(map(int, dict.__getitem__(self, key).split(':')))
		else:
			return dict.__getitem__(self, key)



class UserConfig(object):
	__doc__ = "User configuration storage class. Used to store preferences that\n    should be restored after relaunching pygui.\n\n    This class behaves like a dict, except that whenever one of its mappings\n    is modified, it writes itself to disk.\n\n    You should not use mutable values -- if you do, there's no guarantee that\n    changes made to them will be in fact written to disk. If you want to\n    ensure that changes are written to disk, use the save() method.\n\n\n    /!\\ Important note to developers: /!\\ There is now a config_version key\n    at the UserConfig's root. Whenever you change the structure of UserConfig,\n    (i.e. make changes that could cause the application to crash if UserConfig\n    got overwritten with an older version), please increase config_version by one.\n\n    This will cause pygui to erase the now-obsolete version of the file and revert\n    to default settings upon launch (the new settings will, of course, be saved).\n\n    Hopefully this will save us a lot of grief from users who update pygui\n    without reading their e-mails. Won't prevent a few problems from happening,\n    though (the whole UserConfig thing is, after all, a quick & dirty hack).\n    "
	def __init__(self, conf=None):
		if conf is not None:
			pass
		conf = {}
		self.diff_dict = dict(config_version=conf.get('config_version', -1))
		self.subs_dict = dict()
		self.notify_subs = False

	def __getitem__(self, key):
		return self.subs_dict[key]

	def get(self, key, default=None):
		return self.subs_dict.get(key, default)

	def notify_change(self, id, key, value):
		pass

	def update(self, E, **F):
		self.notify_subs = False
		for key, val in E.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		for key, val in F.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		self.notify_subs = True
		self.diff_dict.update(E, **F)
		self.save()

	def save(self):
		if 'persistence' in plugins and self.diff_dict:
			stream = open(persistent_config_path, 'wb')
			json.dump(self.diff_dict, stream)
			stream.flush()
			os.fsync(stream.fileno())
			stream.close()



user_config = UserConfig(default_conf)
if 'persistence' in plugins:
	try:
		rw_config = json.load(open(persistent_config_path))
		if user_config['config_version'] == rw_config.get('config_version', -1):
			user_config.update(rw_config)
			log.info('System configuration from a previous session found and loaded.')
		else:
			log.warn('Previous system configuration found with an incompatible schema. Discarding it.')
			os.unlink(persistent_config_path)
	except Exception:
		log.warn('Unable to load persistent system configuration. Using default values.')
else:
	log.warn('Configuration persistence disabled. Using default values.')
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb757e76c>}
from __future__ import absolute_import
import os
from peewee.debug import GET_LOGGER
from peewee.version import wybox_version
import simplejson as json
log = GET_LOGGER(__name__)
version = wybox_version()
if version == 'N/A':
	DEBUG = 1
else:
	DEBUG = 0
TMP_DIR = os.getenv('TEMP', '/tmp')
no_PLAYERS = False
no_DBUS = False
fast_pushmenu = True
navigator_cache = False
socket_timeout = 20
themes_dir = '/usr/share/pygui/skins/'
locale_dir = '/usr/share/pygui/locale/'
theme_engine = 'wybox'
fps = 60
key_repeat = 3
key_q_size = 5
block_navigator = True
horizontal_selector = False
add_tv_info_banner_idle_events = False
home_order = ['*tv', 'audio', 'video_image', 'radio', 'web', 'games', 'hdmi_tv1', 'hdmi_tv2', 'image', 'video', 'net_services', 'multiverse', 'parameters', 'test_menu']
display_width, display_height = (1280, 720)
use_serialized_theme = True
default_language = None
admin_age = 100
url_list = [('Google', 'http://www.google.com'), ('WyPlay', 'http://www.wyplay.com'), ('Le Monde', 'http:www.lemonde.fr'), ('Sofinnova', 'http://www.sofinnova.fr')]
resume_video = True
resume_dvd = True
cvbs_resolution = {'pal': (720, 576, 1, 50), 'ntsc': (720, 480, 1, 59)}
random_events_sample = ('LEFT', 'RIGHT', 'UP', 'DOWN', 'HOME', 'MARKER')
random_events_duo = (('LEFT', 'RIGHT'), ('UP', 'DOWN'), ('MARKER', 'MARKER'))
output_driver = 'havana'
architecture = 'stb7100'
code_coverage = False
if False:
	pass
code_profiler = False
shutdown = True
class PluginSet(set):
	__doc__ = "This classe provides a collections of availble plugins\n    that can be loaded to modify the wybox's behavior.\n    Plugins's naming convention is '(universe|module).value'"
	def get(self, prefix=None):
		if prefix is None:
			return list(self)
		ret = set()



plugins = PluginSet(('tv', 'acquisition', 'dvd', 'wymedia', 'wyvas', 'persistence', 'youtube', 'dailymotion', 'popup_blocker', 'wifi', 'input.lirc', 'home.tv', 'home.acquisition', 'home.audio', 'home.video_image', 'home.radio', 'home.web', 'home.games', 'home.parameters', 'hand_actions.navigator', 'hand_actions.marker_navigator', 'hand_actions.player', 'hand_actions.dvd_player', 'hand_actions.tv_player', 'hand_actions.video_image_thumbnail', 'hand_actions.webbrowser', 'gui_engine.mediamenu', 'gui_engine.menu', 'gui_engine.setupparameters', 'gui_engine.tv', 'gui_engine.web', 'gui_engine.window', 'listing.fixed', 'listing.hybrid', 'listing.default', 'parameters.1.tv', 'parameters.2.videophoto', 'parameters.3.generalsetup', 'parameters.4.connections', 'parameters.5.network', 'parameters.6.advanced', 'parameters.7.version'))
import sys
user_config_dir = '/etc/'
rw_dir = '/etc/params/'
HMI_MUSIC = {'lazy_selection': 1.0, 'forward': [2, 4, 6, 10], 'backward': [-2, -4, -6, -10], 'codecs': ['wav', 'mp3', 'ogg'], 'rates': [128, 192, 256, 320], 'left': -5, 'right': 5}
HMI_VIDEO = {'lazy_selection': 0.5, 'languages': ['fr', 'en', 'de', 'es', 'pt', 'nl'], 'aspect_ratio': [0, 1], 'channels': [1, 2, 3, 6, 7], 'channel': 2, 'idle_threshold': 8, 'forward': [2, 3, 6, 12, 25, 50, 100, 300], 'backward': [-2, -3, -6, -12, -25, -50, -100, -300], 'slow': [0.20000000000000001, 0.5, 0.80000000000000004], 'reverse_slow': [0.0], 'seek_percent': 0.10000000000000001, 'seek_period': 72}
HMI_PHOTO = {'lazy_selection': 0.5, 'transitions': ['no_transition', 'fade_to_black', 'fade', 'top_slide'], 'slideshow': [15.0, 10.0, 5.0, 3.0], 'jump': 5, 'thumbnail_row_length': 5}
HMI_BASE = {'preview_delay': 0.5, 'helpbanner_duration': 5.0, 'navigator_listing_delay': 0.20000000000000001, 'search_navigator_delay': 1.3, 'volumewindow_duration': 2.0, 'error_signal_delay': 1.0, 'keyboard_truncate_prefix': '...', 'osd_languages': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'country': ['fr', 'de', 'zh', 'es', 'pt', 'en', 'nl'], 'rcu_block_button0': 3.0, 'rcu_device_poll_interval': 0.014999999999999999, 'rcu_default_margin': 10, 'rcu_move_threshold': 15, 'rcu_gesture_threshold': 15.0, 'rcu_longclic_threshold': 7, 'rcu_buttons_repeat_delay': 0.14999999999999999, 'rcu_buttons_repeat_timeout': 0.14000000000000001, 'rcu_move_repeat_delay': 0.14999999999999999, 'rcu_move_repeat_timeout': 0.14000000000000001}
HMI_TV = {'banner_period': 5, 'record_banner_period': 5, 'record_duration_step': 1800, 'records_duration': [180], 'max_record_duration': 360, 'epg_margins': [0, 5, 10], 'timeshift_length': [30, 60, 120, 180], 'record_time': 7200, 'zap_time': 1.0, 'invert_y_axis': 0}
HMI_VIDEO['forward'] = [2, 8, 25, 100, 300]
HMI_VIDEO['backward'] = [-2, -8, -25, -100, -300]
log.debug('HMI dicts created')
restore_previous_config = True
if not default_language:
	pass
default_conf = {'config_version': 18, 'connections': {'resolution': '1280:720:0:50', 'active_device': 'hdmi', 'composite_output': 'pal', 'component_output': 'rgb', 'hdmi_sound': False, 'auto_frame_rate': False, 'spdif_surround': False, 'scart1_io_mode': 'out', 'scart1_in_mode': 'composite', 'scart1_out_mode': 'rgb', 'scart2_io_mode': 'in', 'scart2_in_mode': 'rgb', 'scart2_out_mode': 's-video'}, 'video': {'language': HMI_VIDEO['languages'][0], 'aspect_ratio': HMI_VIDEO['aspect_ratio'][0], 'display_format': 'letter_box', 'channel': HMI_VIDEO['channels'][0], 'dvdmenulanguage': HMI_VIDEO['languages'][0], 'dvdmovielanguage': HMI_VIDEO['languages'][0], 'dvdsubtitlelanguage': HMI_VIDEO['languages'][0], 'dvdbrowse': False, 'dvdautolaunch': False, 'dvdprotectionlevel': 0, 'dvdchannel': HMI_VIDEO['channels'][0], 'subtitlesfiles': False}, 'music': {'ripcodec': HMI_MUSIC['codecs'][0], 'riprate': HMI_MUSIC['rates'][1], 'autorip': False}, 'photo': {'filename': True, 'zoom': False, 'transition': HMI_PHOTO['transitions'][0], 'period': HMI_PHOTO['slideshow'][0]}, 'tv': {'record_duration': HMI_TV['records_duration'][0], 'max_record_duration': HMI_TV['max_record_duration'], 'epg_margin': HMI_TV['epg_margins'][1], 'timeshift_length': HMI_TV['timeshift_length'][-1], 'lnb_high_voltage': False, 'last_scan_time': 0, 'scan_with_scrambled': True, 'last_channel_index': None, 'last_favorite_name': u'all_channels_list'}, 'base': {'help_banner': 1, 'country': HMI_BASE['country'][0], 'language': default_language, 'timeupdatemode': 3, 'timeformat': 1, 'dateformat': 0, 'timezone': 'Europe/Paris', 'firstboot': True}, 'security': {'secretcode': None, 'parent_mode': True, 'parental_control': False, 'show_hidden': True, 'question': None, 'answer': None, 'maturity_rating': 0}, 'power': {'screensaver_type': 'image', 'screensaver_threshold': 300}, 'sound': {'volume': 10, 'mute': 0}, 'network': {'type': 'wired', 'iface': 'eth0', 'upnp': True, 'wifi_name': None, 'wifi_security': None, 'wifi_key': None}, 'advanced': {'start_on_demo_mode': False, 'last_universe': None, 'demo_mode': False}, 'net': {'login': None, 'password': None}}
restricted_env = {'__builtins__': None, 'plugins': plugins, 'True': True, 'False': False, 'HMI_BASE': HMI_BASE, 'HMI_VIDEO': HMI_VIDEO, 'HMI_MUSIC': HMI_MUSIC, 'HMI_PHOTO': HMI_PHOTO, 'HMI_TV': HMI_TV}
try:
	user_configuration = os.path.join(user_config_dir, 'local_conf.py')
	_loc = {}
	execfile(user_configuration, restricted_env, _loc)
	locals().update(_loc)
	log.debug('user configuration file : %s' % user_configuration)
except IOError:
	log.info('No local configuration found.')
for plug in <genexpr>(os.environ.get('PLUGINS', '').split(':')):
	if plug[0] == '-':
		plugins.discard(plug[1:])
		continue
	plugins.add(plug)
persistent_config_path = '/etc/params/wy_config'
import platform
if platform.machine() != 'sh4':
	output_driver = 'dummy'
	architecture = 'pc'
	plugins.discard('persistence')
class _SubDict(dict):
	def __init__(self, values, key, parent):
		dict.__init__(self, values)
		self.key = key
		self.parent = parent

	def __setitem__(self, key, value):
		if key == 'resolution' and self.key == 'connections' and isinstance(value, (tuple, list)):
			value = ':'.join(map(str, value))
			dict.__setitem__(self, key, value)
		else:
			dict.__setitem__(self, key, value)
		if self.parent.notify_subs:
			self.parent.notify_change(self.key, key, value)

	def __getitem__(self, key):
		if key == 'resolution' and self.key == 'connections':
			return tuple(map(int, dict.__getitem__(self, key).split(':')))
		else:
			return dict.__getitem__(self, key)



class UserConfig(object):
	__doc__ = "User configuration storage class. Used to store preferences that\n    should be restored after relaunching pygui.\n\n    This class behaves like a dict, except that whenever one of its mappings\n    is modified, it writes itself to disk.\n\n    You should not use mutable values -- if you do, there's no guarantee that\n    changes made to them will be in fact written to disk. If you want to\n    ensure that changes are written to disk, use the save() method.\n\n\n    /!\\ Important note to developers: /!\\ There is now a config_version key\n    at the UserConfig's root. Whenever you change the structure of UserConfig,\n    (i.e. make changes that could cause the application to crash if UserConfig\n    got overwritten with an older version), please increase config_version by one.\n\n    This will cause pygui to erase the now-obsolete version of the file and revert\n    to default settings upon launch (the new settings will, of course, be saved).\n\n    Hopefully this will save us a lot of grief from users who update pygui\n    without reading their e-mails. Won't prevent a few problems from happening,\n    though (the whole UserConfig thing is, after all, a quick & dirty hack).\n    "
	def __init__(self, conf=None):
		if conf is not None:
			pass
		conf = {}
		self.diff_dict = dict(config_version=conf.get('config_version', -1))
		self.subs_dict = dict()
		self.notify_subs = False

	def __getitem__(self, key):
		return self.subs_dict[key]

	def get(self, key, default=None):
		return self.subs_dict.get(key, default)

	def notify_change(self, id, key, value):
		pass

	def update(self, E, **F):
		self.notify_subs = False
		for key, val in E.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		for key, val in F.iteritems():
			if isinstance(self.subs_dict[key], dict):
				self.subs_dict[key].update(val)
				continue
		self.notify_subs = True
		self.diff_dict.update(E, **F)
		self.save()

	def save(self):
		if 'persistence' in plugins and self.diff_dict:
			stream = open(persistent_config_path, 'wb')
			json.dump(self.diff_dict, stream)
			stream.flush()
			os.fsync(stream.fileno())
			stream.close()



user_config = UserConfig(default_conf)
if 'persistence' in plugins:
	try:
		rw_config = json.load(open(persistent_config_path))
		if user_config['config_version'] == rw_config.get('config_version', -1):
			user_config.update(rw_config)
			log.info('System configuration from a previous session found and loaded.')
		else:
			log.warn('Previous system configuration found with an incompatible schema. Discarding it.')
			os.unlink(persistent_config_path)
	except Exception:
		log.warn('Unable to load persistent system configuration. Using default values.')
else:
	log.warn('Configuration persistence disabled. Using default values.')
